Files
HausApp/apps/native/contexts/app-theme-context.tsx
René Schober 9ddc7c6d7a Production deployment setup + feature complete
- Dockerfile + deploy.sh for Hetzner server
- Email verification via Better Auth + Resend
- Invite code flow (6-digit OTP, generate/join)
- Settlement share percent fix (payer vs debtor)
- OCR scanner fixes (date display, retry, viewfinder)
- app.json icon/splash/adaptive-icon configured
- iOS deployment target 15.5 (ML Kit requirement)
- DB migration 0014: household_invitations table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 11:54:22 +01:00

29 lines
839 B
TypeScript

import { createContext, useContext, useState, useEffect } from "react";
import { Appearance } from "react-native";
import { Uniwind } from "uniwind";
type AppThemeContextType = { themeName: string };
const AppThemeContext = createContext<AppThemeContextType>({ themeName: "light" });
export const AppThemeProvider = ({ children }: { children: React.ReactNode }) => {
const [themeName, setThemeName] = useState<string>(
() => Uniwind.currentTheme ?? "light",
);
useEffect(() => {
const sub = Appearance.addChangeListener(({ colorScheme }) => {
setThemeName(colorScheme ?? "light");
});
return () => sub.remove();
}, []);
return (
<AppThemeContext.Provider value={{ themeName }}>
{children}
</AppThemeContext.Provider>
);
};
export const useAppTheme = () => useContext(AppThemeContext);