99 useAnimatedValue ,
1010} from 'react-native' ;
1111import type { PropsWithChildren } from 'react' ;
12+ import { Theme } from '@react-navigation/native' ;
1213
1314type NavigationAction = {
1415 type : string ,
@@ -42,23 +43,11 @@ type RouteType = {
4243 params : any ,
4344}
4445
45- type Theme = {
46- dark : boolean ;
47- colors : {
48- primary : string ;
49- background : string ;
50- card : string ;
51- text : string ;
52- border : string ;
53- notification : string ;
54- } ;
55- } ;
56-
5746type NavigationContainerProps = PropsWithChildren < {
5847 theme ?: Theme ;
5948} > ;
6049
61- // Store the current theme in a context for useTheme hook
50+ // Store the current theme for useTheme hook
6251let currentTheme : Theme | null = null ;
6352
6453const NavigationContainer = ( { children, theme} : NavigationContainerProps ) => {
@@ -95,7 +84,6 @@ const NavigationContainer = ({children, theme}: NavigationContainerProps) => {
9584 routes : routes ,
9685 parameters : parameters ,
9786 } ;
98-
9987 return (
10088 < NavigationContext . Provider value = { navigationContext } >
10189 { children }
@@ -365,6 +353,18 @@ const useTheme = () => {
365353 } ;
366354} ;
367355
356+ const Theme = {
357+ colors : {
358+ primary : '#0066cc' ,
359+ background : '#FFFFFF' ,
360+ card : '#FFFFFF' ,
361+ text : '#505050' ,
362+ border : '#E6E6E6' ,
363+ notification : 'rgb(255, 59, 48)' ,
364+ } ,
365+ dark : false ,
366+ } ;
367+
368368const useNavigation = ( ) => {
369369 const navigationContext = React . useContext ( NavigationContext ) ;
370370 return navigationContext ;
@@ -376,5 +376,4 @@ const DrawerActions = {
376376 toggleDrawer : ( ) => { console . log ( 'toggleDrawer' ) ; return { type : 'TOGGLE_DRAWER' } ; } ,
377377} ;
378378
379- export { NavigationContainer , StackNavigator , StackScreen , createNativeStackNavigator , createDrawerNavigator , getDrawerStatusFromState , useIsFocused , useTheme , useNavigation , DrawerActions } ;
380- export type { Theme } ;
379+ export { NavigationContainer , StackNavigator , StackScreen , createNativeStackNavigator , createDrawerNavigator , getDrawerStatusFromState , useIsFocused , useTheme , Theme , useNavigation , DrawerActions } ;
0 commit comments