99 NavigationState ,
1010 PartialState ,
1111 DefaultTheme ,
12- Route
12+ Route ,
13+ RouteProp
1314} from '@react-navigation/native'
1415import { createNativeStackNavigator , NativeStackNavigationOptions } from '@react-navigation/native-stack'
1516import { createDrawerNavigator } from '@react-navigation/drawer'
@@ -31,6 +32,7 @@ import { EdgeInsets, SafeAreaProvider, useSafeAreaInsets } from 'react-native-sa
3132import SplashScreen from 'react-native-splash-screen'
3233import NavigationService from './NavigationService'
3334import { MainScreenProps , RootStackParamList , ROUTES } from './routes'
35+ import { HeaderButton } from '@src/screens/components'
3436
3537/**
3638 * dayjs
@@ -177,6 +179,19 @@ const HotDrawerNavigator = (initialRouteName?: string) => {
177179 )
178180}
179181
182+ const MainBottomHeaderLeft = ( { route } : { route : RouteProp < RootStackParamList > } ) : ReactNode => {
183+ const { theme } = useTheme ( )
184+ const focusRouteName = getFocusedRouteNameFromRoute ( route ) ?? ROUTES . HotDraw
185+ return focusRouteName === ROUTES . HotDraw ? < HeaderButton source = { theme . assets . images . icons . header . more } /> : undefined
186+ }
187+
188+ const MainBottomTabHeaderRight = ( { route } : { route : RouteProp < RootStackParamList > } ) : ReactNode => {
189+ const { theme } = useTheme ( )
190+
191+ const focusRouteName = getFocusedRouteNameFromRoute ( route ) ?? ROUTES . HotDraw
192+ return focusRouteName === ROUTES . HotDraw ? < HeaderButton source = { theme . assets . images . icons . header . stat } /> : undefined
193+ }
194+
180195const MainAppNavigator = ( { navigation, route } : MainScreenProps ) => {
181196 const insets = useSafeAreaInsets ( )
182197 const { unread } = useUnRead ( )
@@ -315,7 +330,7 @@ export const AppNavigationContainer = () => {
315330 }
316331 barStyle = { theme . name === 'dark' ? 'light-content' : 'dark-content' }
317332 />
318- < StackNavigator . Navigator initialRouteName = { ! token ? ROUTES . SignIn : ROUTES . Main } >
333+ < StackNavigator . Navigator initialRouteName = { ! token ? ROUTES . Main : ROUTES . Main } >
319334 < StackNavigator . Screen
320335 name = { ROUTES . SignIn }
321336 component = { Screens . SignInScreen }
@@ -333,9 +348,11 @@ export const AppNavigationContainer = () => {
333348 component = { MainAppNavigator }
334349 options = { ( { route } ) => ( {
335350 ...defaultScreenOptions ( theme ) ,
336- headerShadowVisible : ! [ ROUTES . HomeTabs ] . includes (
351+ headerShadowVisible : ! [ ROUTES . HotDraw ] . includes (
337352 getFocusedRouteNameFromRoute ( route ) ?? ( ROUTES . Nodes as any )
338353 ) ,
354+ headerLeft : ( ) => MainBottomHeaderLeft ( { route } ) ,
355+ headerRight : ( ) => MainBottomTabHeaderRight ( { route } ) ,
339356 headerTitle : getHeaderTitle ( route )
340357 } ) }
341358 initialParams = { {
0 commit comments