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

48 lines
1.5 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-06 21:01:38 +01:00
import { KeyboardAvoidingView, 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-03-28 23:31:10 +02:00
const { t } = useTranslation('screenTabs')
2021-01-07 19:13:09 +01:00
return (
2021-03-06 21:01:38 +01:00
<KeyboardAvoidingView
style={{ flex: 1 }}
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
2021-01-14 00:43:35 +01:00
>
2021-03-06 21:01:38 +01:00
<Stack.Navigator
screenOptions={{ headerHideShadow: true, headerTopInsetEnabled: false }}
>
<Stack.Screen
name='Screen-Me-Switch-Root'
component={ScreenMeSwitchRoot}
options={{
2021-03-28 23:31:10 +02:00
headerTitle: t('me.stacks.switch.name'),
2021-03-06 21:01:38 +01:00
...(Platform.OS === 'android' && {
headerCenter: () => (
2021-03-28 23:31:10 +02:00
<HeaderCenter content={t('me.stacks.switch.name')} />
2021-03-06 21:01:38 +01:00
)
}),
headerLeft: () => (
<HeaderLeft
content='ChevronDown'
onPress={() => navigation.goBack()}
/>
)
}}
/>
</Stack.Navigator>
</KeyboardAvoidingView>
2021-01-07 19:13:09 +01:00
)
}
export default ScreenMeSwitch