Move to Phase 4-5

This commit is contained in:
gpt-engineer-app[bot]
2025-10-21 18:15:22 +00:00
parent ae548aa389
commit 3b82887974
8 changed files with 329 additions and 77 deletions

View File

@@ -1,4 +1,5 @@
import React, { createContext, useContext, useEffect, useState } from "react"
import * as storage from "@/lib/localStorage"
type Theme = "dark" | "light" | "system"
@@ -27,7 +28,7 @@ export function ThemeProvider({
...props
}: ThemeProviderProps) {
const [theme, setTheme] = useState<Theme>(
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme
() => (storage.getItem(storageKey) as Theme) || defaultTheme
)
useEffect(() => {
@@ -51,7 +52,7 @@ export function ThemeProvider({
const value = {
theme,
setTheme: (theme: Theme) => {
localStorage.setItem(storageKey, theme)
storage.setItem(storageKey, theme)
setTheme(theme)
},
}