Squash merge feat/expo-app: app-expo, .cursor, workflows, package.json, .husky; remove app-android, app-ios, react-app
This commit is contained in:
20
app-expo/src/core/navigation-theme-provider.tsx
Normal file
20
app-expo/src/core/navigation-theme-provider.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { ThemeProvider } from '@react-navigation/native';
|
||||
import React, { type PropsWithChildren } from 'react';
|
||||
|
||||
import { useAppSettingsContext } from '@/core/app-settings-context';
|
||||
import { useColorScheme } from '@/hooks/use-color-scheme';
|
||||
import { getNavTheme } from '@/lib/theme';
|
||||
|
||||
/**
|
||||
* Wraps React Navigation ThemeProvider with theme resolved from
|
||||
* design-tokens (themeName + colorScheme).
|
||||
* Must be used inside AppSettingsProvider.
|
||||
*/
|
||||
export function NavigationThemeProvider({ children }: PropsWithChildren) {
|
||||
const { themeName } = useAppSettingsContext();
|
||||
const { colorScheme } = useColorScheme();
|
||||
const resolved = colorScheme === 'dark' ? 'dark' : 'light';
|
||||
const theme = getNavTheme(themeName, resolved);
|
||||
|
||||
return <ThemeProvider value={theme}>{children}</ThemeProvider>;
|
||||
}
|
||||
Reference in New Issue
Block a user