mirror of
https://github.com/dyzulk/trustlab.git
synced 2026-01-26 13:32:06 +07:00
feat(web): change default theme to DARK
This commit is contained in:
@@ -16,12 +16,12 @@ const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
|
|||||||
export const ThemeProvider: React.FC<{ children: React.ReactNode }> = ({
|
export const ThemeProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||||
children,
|
children,
|
||||||
}) => {
|
}) => {
|
||||||
const [theme, setThemeState] = useState<Theme>("system");
|
const [theme, setThemeState] = useState<Theme>("dark");
|
||||||
const [isInitialized, setIsInitialized] = useState(false);
|
const [isInitialized, setIsInitialized] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const savedTheme = localStorage.getItem("theme") as Theme | null;
|
const savedTheme = localStorage.getItem("theme") as Theme | null;
|
||||||
const initialTheme = savedTheme || "system";
|
const initialTheme = savedTheme || "dark";
|
||||||
setThemeState(initialTheme);
|
setThemeState(initialTheme);
|
||||||
setIsInitialized(true);
|
setIsInitialized(true);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
Reference in New Issue
Block a user