- React Navigation 7: conditional root stack (Auth | Main | Repository | Settings | Accounts modal), 5 bottom tabs with nested native stacks - typed param lists, deep-link config, header options, root-nav helper - providers: gesture handler, safe area, theme, persisted query client, app lock - i18next + expo-localization (en/nl), persisted language preference
25 lines
777 B
TypeScript
25 lines
777 B
TypeScript
/**
|
|
* Shared native-stack screen options derived from the active theme, so every
|
|
* stack (tabs, repository, settings, accounts) renders identical headers.
|
|
*/
|
|
|
|
import { useMemo } from 'react';
|
|
import type { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
|
|
import { useTheme } from '@/theme/theme-provider';
|
|
|
|
export function useStackScreenOptions(): NativeStackNavigationOptions {
|
|
const { colors } = useTheme();
|
|
return useMemo(
|
|
() => ({
|
|
headerStyle: { backgroundColor: colors.surface },
|
|
headerTintColor: colors.text,
|
|
headerTitleStyle: { color: colors.text },
|
|
headerShadowVisible: false,
|
|
headerBackButtonDisplayMode: 'minimal',
|
|
contentStyle: { backgroundColor: colors.background },
|
|
}),
|
|
[colors],
|
|
);
|
|
}
|