tooot/src/screens/Tabs/Me/Switch.tsx

41 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-01-14 00:43:35 +01:00
import { HeaderCenter, HeaderLeft } from '@components/Header'
2021-01-24 02:25:43 +01:00
import { StackScreenProps } from '@react-navigation/stack'
2021-01-07 19:13:09 +01:00
import React from 'react'
2021-01-19 01:13:45 +01:00
import { useTranslation } from 'react-i18next'
2021-03-02 01:17:06 +01:00
import { Platform } from 'react-native'
2021-01-07 19:13:09 +01:00
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
import ScreenMeSwitchRoot from './Switch/Root'
const Stack = createNativeStackNavigator()
2021-01-24 02:25:43 +01:00
const ScreenMeSwitch: React.FC<StackScreenProps<
2021-02-05 01:13:57 +01:00
Nav.TabMeStackParamList,
'Tab-Me-Switch'
2021-01-24 02:25:43 +01:00
>> = ({ navigation }) => {
2021-01-19 01:13:45 +01:00
const { t } = useTranslation()
2021-01-07 19:13:09 +01:00
return (
2021-01-14 00:43:35 +01:00
<Stack.Navigator
screenOptions={{ headerHideShadow: true, headerTopInsetEnabled: false }}
>
2021-01-07 19:13:09 +01:00
<Stack.Screen
name='Screen-Me-Switch-Root'
component={ScreenMeSwitchRoot}
options={{
2021-01-19 01:13:45 +01:00
headerTitle: t('meSwitch:heading'),
2021-01-14 00:43:35 +01:00
...(Platform.OS === 'android' && {
2021-01-19 01:13:45 +01:00
headerCenter: () => <HeaderCenter content={t('meSwitch:heading')} />
2021-01-14 00:43:35 +01:00
}),
2021-01-07 19:13:09 +01:00
headerLeft: () => (
2021-02-13 13:08:34 +01:00
<HeaderLeft
content='ChevronDown'
onPress={() => navigation.goBack()}
/>
2021-01-07 19:13:09 +01:00
)
}}
/>
</Stack.Navigator>
)
}
export default ScreenMeSwitch