mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 14:01:24 +00:00
chore: update user settings
This commit is contained in:
parent
8992d48b3e
commit
908f95772d
@ -84,8 +84,9 @@ func getUserSetting(ctx context.Context, s *store.Store, userID int32) (*apiv2pb
|
|||||||
}
|
}
|
||||||
|
|
||||||
userSetting := &apiv2pb.UserSetting{
|
userSetting := &apiv2pb.UserSetting{
|
||||||
Id: userID,
|
Id: userID,
|
||||||
Locale: apiv2pb.UserSetting_LOCALE_EN,
|
Locale: apiv2pb.UserSetting_LOCALE_EN,
|
||||||
|
ColorTheme: apiv2pb.UserSetting_COLOR_THEME_LIGHT,
|
||||||
}
|
}
|
||||||
for _, setting := range userSettings {
|
for _, setting := range userSettings {
|
||||||
if setting.Key == storepb.UserSettingKey_USER_SETTING_LOCALE {
|
if setting.Key == storepb.UserSettingKey_USER_SETTING_LOCALE {
|
||||||
|
@ -8,7 +8,7 @@ const PreferenceSection: React.FC = () => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const userSetting = userStore.getCurrentUserSetting();
|
const userSetting = userStore.getCurrentUserSetting();
|
||||||
const language = userSetting.locale || UserSetting_Locale.EN;
|
const language = userSetting.locale;
|
||||||
const colorTheme = userSetting.colorTheme;
|
const colorTheme = userSetting.colorTheme;
|
||||||
|
|
||||||
const languageOptions = [
|
const languageOptions = [
|
||||||
@ -23,10 +23,6 @@ const PreferenceSection: React.FC = () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const colorThemeOptions = [
|
const colorThemeOptions = [
|
||||||
{
|
|
||||||
value: "COLOR_THEME_UNSPECIFIED",
|
|
||||||
label: "Auto",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
value: "COLOR_THEME_LIGHT",
|
value: "COLOR_THEME_LIGHT",
|
||||||
label: "Light",
|
label: "Light",
|
||||||
@ -52,6 +48,10 @@ const PreferenceSection: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSelectColorTheme = async (colorTheme: UserSetting_ColorTheme) => {
|
const handleSelectColorTheme = async (colorTheme: UserSetting_ColorTheme) => {
|
||||||
|
if (!colorTheme) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await userStore.updateUserSetting(
|
await userStore.updateUserSetting(
|
||||||
{
|
{
|
||||||
...userSetting,
|
...userSetting,
|
||||||
|
@ -74,8 +74,8 @@ const Home: React.FC = () => {
|
|||||||
loading
|
loading
|
||||||
</div>
|
</div>
|
||||||
) : orderedShortcutList.length === 0 ? (
|
) : orderedShortcutList.length === 0 ? (
|
||||||
<div className="py-16 w-full flex flex-col justify-center items-center">
|
<div className="py-16 w-full flex flex-col justify-center items-center text-gray-400">
|
||||||
<Icon.PackageOpen className="w-16 h-auto text-gray-400" />
|
<Icon.PackageOpen className="w-16 h-auto" strokeWidth="1" />
|
||||||
<p className="mt-4">No shortcuts found.</p>
|
<p className="mt-4">No shortcuts found.</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
@ -18,10 +18,6 @@ const Setting: React.FC = () => {
|
|||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<>
|
<>
|
||||||
<Divider />
|
<Divider />
|
||||||
<div>
|
|
||||||
<h2 className="text-2xl font-bold">Workspace setting</h2>
|
|
||||||
<p className="text-gray-500 text-sm">Manage your workspace.</p>
|
|
||||||
</div>
|
|
||||||
<MemberSection />
|
<MemberSection />
|
||||||
<WorkspaceSection />
|
<WorkspaceSection />
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user