chore: custom brand color
This commit is contained in:
@@ -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'
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user