Fix wallet modal, add Lute wallet, dark mode, add comments

This commit is contained in:
SaraJane
2026-01-02 20:41:49 +00:00
parent ceaf5b33f4
commit f9e4e3dd3d
11 changed files with 168 additions and 27 deletions

View File

@ -3,6 +3,9 @@ import { useEffect, useState } from 'react'
const THEME_KEY = 'tokenize_theme'
type Theme = 'light' | 'dark'
/**
* Get initial theme preference from localStorage or system preference
*/
function getInitialTheme(): Theme {
const saved = localStorage.getItem(THEME_KEY)
if (saved === 'light' || saved === 'dark') return saved
@ -10,6 +13,11 @@ function getInitialTheme(): Theme {
return prefersDark ? 'dark' : 'light'
}
/**
* ThemeToggle Component
* Allows users to toggle between light and dark modes
* Persists theme preference to localStorage and applies Tailwind's dark class
*/
export default function ThemeToggle() {
const [theme, setTheme] = useState<Theme>(() => getInitialTheme())
const [mounted, setMounted] = useState(false)