From 8b6828ecceaac5886728093cb002d23c17849047 Mon Sep 17 00:00:00 2001 From: Carter Date: Tue, 15 Apr 2025 14:05:08 -0600 Subject: [PATCH] getThemeType hook returns the resolved theme now --- src/theme/themeType.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/theme/themeType.ts b/src/theme/themeType.ts index eba1431..27dd364 100644 --- a/src/theme/themeType.ts +++ b/src/theme/themeType.ts @@ -1,8 +1,12 @@ +import { useThemeMode } from "./AppThemeProvider"; + export type ThemeType = "light" | "dark" | "system"; export function getThemeType(): ThemeType { - let theme = localStorage.getItem("theme"); - return theme === "light" ? "light" : "dark"; + const themeMode = useThemeMode() + // return localStorage.getItem("theme"); + // return theme === "light" ? "light" : "dark"; + return themeMode.resolvedMode } export function setThemeType(theme: ThemeType) { @@ -10,6 +14,8 @@ export function setThemeType(theme: ThemeType) { } export function getThemeMode(): ThemeType { - let theme = localStorage.getItem("theme"); - return theme === "light" ? "light" : "dark"; + const themeMode = useThemeMode() + // return localStorage.getItem("theme"); + // return theme === "light" ? "light" : "dark"; + return themeMode.resolvedMode } \ No newline at end of file