chore: custom brand color

This commit is contained in:
jialin
2025-04-28 10:05:06 +08:00
parent 3fb3381a19
commit fb90d79eb3
12 changed files with 398 additions and 139 deletions
+5 -1
View File
@@ -1,14 +1,17 @@
import { colorPrimary } from '@/config/theme';
import { atom } from 'jotai';
import { atomWithStorage } from 'jotai/utils';
type UserSettings = {
theme: 'light' | 'realDark' | 'auto';
colorPrimary: string;
isDarkTheme?: boolean;
};
export const userSettingsAtom = atomWithStorage<UserSettings>('userSettings', {
theme: 'light',
isDarkTheme: false
isDarkTheme: false,
colorPrimary: colorPrimary
});
export const userSettingsHelperAtom = atom(
@@ -21,6 +24,7 @@ export const userSettingsHelperAtom = atom(
};
set(userSettingsAtom, {
...newSettings,
colorPrimary: newSettings.colorPrimary || colorPrimary,
isDarkTheme: newSettings.theme === 'realDark'
});
}