diff --git a/App.tsx b/App.tsx index d949d28..3c04f26 100644 --- a/App.tsx +++ b/App.tsx @@ -17,6 +17,7 @@ import ScannerScreen from './src/screens/ScannerScreen'; import SettingsScreen from './src/screens/SettingsScreen'; import LiveAlarmScreen from './src/screens/LiveAlarmScreen'; import { LoadingView } from './src/components/ui'; +import { bg } from './src/theme/tokens'; import { navigationRef, openLiveAlarm } from './src/navigationRef'; import { getLaunchAlert } from './src/services/alarmNative'; import type { RootStackParamList } from './src/navigation'; @@ -130,7 +131,7 @@ function Root() { function App() { return ( - + diff --git a/src/components/ui.tsx b/src/components/ui.tsx index 755dcb8..0ef5a17 100644 --- a/src/components/ui.tsx +++ b/src/components/ui.tsx @@ -23,6 +23,7 @@ import { type LucideIcon, } from 'lucide-react-native'; import { + bg, border, danger, dangerDeep, @@ -536,7 +537,7 @@ export const styles = StyleSheet.create({ paddingVertical: 48, }, emptyAction: { marginTop: space6, alignSelf: 'stretch' }, - loading: { alignItems: 'center', justifyContent: 'center', paddingVertical: 48 }, + loading: { alignItems: 'center', justifyContent: 'center', paddingVertical: 48, backgroundColor: bg }, errorBanner: { borderWidth: 1, borderColor: 'rgba(248,113,113,0.3)', diff --git a/src/screens/LoginScreen.tsx b/src/screens/LoginScreen.tsx index c43db83..6a5248c 100644 --- a/src/screens/LoginScreen.tsx +++ b/src/screens/LoginScreen.tsx @@ -12,7 +12,7 @@ import { Screen, TextInputBox, } from '../components/ui'; -import { space4, text, textMuted, textSecondary, typeCaption, typeLabel, typeTitle } from '../theme/tokens'; +import { space4, text, textMuted, textSecondary, typeCaption, typeLabel, typeTitle, bg } from '../theme/tokens'; type Mode = 'signin' | 'register'; @@ -54,7 +54,7 @@ export default function LoginScreen() { }; return ( - + {!online ? : null} (undefined); export function ThemeProvider({ children }: { children: React.ReactNode }) { - const [isDark, setIsDark] = useState(false); + // The app's palette is dark by construction (`theme/tokens.ts` are fixed + // dark values); this flag only drives heroUI's own theme so its controls + // match. Defaulting to light left every heroUI surface light while the + // app's text tokens stayed light-on-light — the white-on-white login page. + const [isDark, setIsDark] = useState(true); useEffect(() => { let cancelled = false; (async () => { try { const raw = await AsyncStorage.getItem(THEME_KEY); - const dark = raw === 'dark'; + const dark = raw !== 'light'; if (!cancelled) setIsDark(dark); Uniwind.setTheme(dark ? 'dark' : 'light'); } catch {