feat: remove OTP gate from transactions, fix categories auth, add implementation plan
- Remove OtpGateGuard from transactions controller (OTP verified at login) - Fix categories controller to use authenticated user instead of TEMP_USER_ID - Add comprehensive implementation plan document - Update .env.example with WEB_APP_URL - Prepare for admin dashboard development
This commit is contained in:
@@ -9,12 +9,17 @@ type ThemeProviderProps = {
|
||||
|
||||
export function ThemeProvider({
|
||||
children,
|
||||
defaultTheme = 'system',
|
||||
defaultTheme = 'light',
|
||||
storageKey = 'tabungin-ui-theme',
|
||||
}: ThemeProviderProps) {
|
||||
const [theme, setTheme] = useState<Theme>(
|
||||
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme
|
||||
)
|
||||
const [theme, setTheme] = useState<Theme>(() => {
|
||||
const stored = localStorage.getItem(storageKey) as Theme
|
||||
// If system theme is stored, convert to light
|
||||
if (stored === 'system') {
|
||||
return 'light'
|
||||
}
|
||||
return stored || defaultTheme
|
||||
})
|
||||
|
||||
const [actualTheme, setActualTheme] = useState<'dark' | 'light'>('light')
|
||||
|
||||
@@ -23,19 +28,10 @@ export function ThemeProvider({
|
||||
|
||||
root.classList.remove('light', 'dark')
|
||||
|
||||
if (theme === 'system') {
|
||||
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)')
|
||||
.matches
|
||||
? 'dark'
|
||||
: 'light'
|
||||
|
||||
root.classList.add(systemTheme)
|
||||
setActualTheme(systemTheme)
|
||||
return
|
||||
}
|
||||
|
||||
root.classList.add(theme)
|
||||
setActualTheme(theme)
|
||||
// Only support light and dark, no system
|
||||
const themeToApply = theme === 'system' ? 'light' : theme
|
||||
root.classList.add(themeToApply)
|
||||
setActualTheme(themeToApply)
|
||||
}, [theme])
|
||||
|
||||
const value = {
|
||||
|
||||
Reference in New Issue
Block a user