2021-01-14 00:43:35 +01:00
|
|
|
import { HeaderCenter, HeaderLeft } from '@components/Header'
|
2021-08-21 01:45:43 +02:00
|
|
|
import { createNativeStackNavigator } from '@react-navigation/native-stack'
|
2021-08-29 15:25:38 +02:00
|
|
|
import { TabMeStackParamList } from '@utils/navigation/navigators'
|
2021-01-07 22:18:14 +01:00
|
|
|
import React from 'react'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
2021-01-14 00:43:35 +01:00
|
|
|
import { Platform } from 'react-native'
|
2021-05-09 21:59:03 +02:00
|
|
|
import TabMeBookmarks from './Me/Bookmarks'
|
|
|
|
import TabMeConversations from './Me/Cconversations'
|
|
|
|
import TabMeFavourites from './Me/Favourites'
|
|
|
|
import TabMeLists from './Me/Lists'
|
|
|
|
import TabMeListsList from './Me/ListsList'
|
|
|
|
import TabMeProfile from './Me/Profile'
|
|
|
|
import TabMePush from './Me/Push'
|
|
|
|
import TabMeRoot from './Me/Root'
|
|
|
|
import TabMeSettings from './Me/Settings'
|
|
|
|
import TabMeSettingsFontsize from './Me/SettingsFontsize'
|
2022-05-28 22:18:03 +02:00
|
|
|
import TabMeSettingsLanguage from './Me/SettingsLanguage'
|
2021-05-09 21:59:03 +02:00
|
|
|
import TabMeSwitch from './Me/Switch'
|
2021-08-29 15:25:38 +02:00
|
|
|
import TabSharedRoot from './Shared/Root'
|
2020-11-28 17:07:30 +01:00
|
|
|
|
2021-08-29 15:25:38 +02:00
|
|
|
const Stack = createNativeStackNavigator<TabMeStackParamList>()
|
2020-11-21 13:19:05 +01:00
|
|
|
|
2021-02-08 23:19:55 +01:00
|
|
|
const TabMe = React.memo(
|
|
|
|
() => {
|
2021-03-28 23:31:10 +02:00
|
|
|
const { t } = useTranslation('screenTabs')
|
2020-11-24 00:18:47 +01:00
|
|
|
|
2021-02-08 23:19:55 +01:00
|
|
|
return (
|
2021-08-21 01:45:43 +02:00
|
|
|
<Stack.Navigator screenOptions={{ headerShadowVisible: false }}>
|
2021-02-08 23:19:55 +01:00
|
|
|
<Stack.Screen
|
|
|
|
name='Tab-Me-Root'
|
2021-05-09 21:59:03 +02:00
|
|
|
component={TabMeRoot}
|
2021-02-08 23:19:55 +01:00
|
|
|
options={{
|
2021-08-21 01:45:43 +02:00
|
|
|
headerShadowVisible: false,
|
2021-02-08 23:19:55 +01:00
|
|
|
headerStyle: { backgroundColor: 'rgba(255, 255, 255, 0)' },
|
2021-08-21 01:45:43 +02:00
|
|
|
headerShown: false
|
2021-02-08 23:19:55 +01:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Stack.Screen
|
|
|
|
name='Tab-Me-Bookmarks'
|
2021-05-09 21:59:03 +02:00
|
|
|
component={TabMeBookmarks}
|
2021-02-08 23:19:55 +01:00
|
|
|
options={({ navigation }: any) => ({
|
2021-12-18 23:44:08 +01:00
|
|
|
title: t('me.stacks.bookmarks.name'),
|
2021-02-08 23:19:55 +01:00
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
2021-03-28 23:31:10 +02:00
|
|
|
<HeaderCenter content={t('me.stacks.bookmarks.name')} />
|
2021-02-08 23:19:55 +01:00
|
|
|
)
|
|
|
|
}),
|
|
|
|
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
<Stack.Screen
|
|
|
|
name='Tab-Me-Conversations'
|
2021-05-09 21:59:03 +02:00
|
|
|
component={TabMeConversations}
|
2021-02-08 23:19:55 +01:00
|
|
|
options={({ navigation }: any) => ({
|
2021-12-18 23:44:08 +01:00
|
|
|
title: t('me.stacks.conversations.name'),
|
2021-02-08 23:19:55 +01:00
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
2021-03-28 23:31:10 +02:00
|
|
|
<HeaderCenter content={t('me.stacks.conversations.name')} />
|
2021-02-08 23:19:55 +01:00
|
|
|
)
|
|
|
|
}),
|
|
|
|
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
<Stack.Screen
|
|
|
|
name='Tab-Me-Favourites'
|
2021-05-09 21:59:03 +02:00
|
|
|
component={TabMeFavourites}
|
2021-02-08 23:19:55 +01:00
|
|
|
options={({ navigation }: any) => ({
|
2021-12-18 23:44:08 +01:00
|
|
|
title: t('me.stacks.favourites.name'),
|
2021-02-08 23:19:55 +01:00
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
2021-03-28 23:31:10 +02:00
|
|
|
<HeaderCenter content={t('me.stacks.favourites.name')} />
|
2021-02-08 23:19:55 +01:00
|
|
|
)
|
|
|
|
}),
|
|
|
|
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
<Stack.Screen
|
|
|
|
name='Tab-Me-Lists'
|
2021-05-09 21:59:03 +02:00
|
|
|
component={TabMeLists}
|
2021-02-08 23:19:55 +01:00
|
|
|
options={({ navigation }: any) => ({
|
2021-12-18 23:44:08 +01:00
|
|
|
title: t('me.stacks.lists.name'),
|
2021-02-08 23:19:55 +01:00
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
2021-03-28 23:31:10 +02:00
|
|
|
<HeaderCenter content={t('me.stacks.lists.name')} />
|
2021-02-08 23:19:55 +01:00
|
|
|
)
|
|
|
|
}),
|
|
|
|
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
<Stack.Screen
|
|
|
|
name='Tab-Me-Lists-List'
|
2021-05-09 21:59:03 +02:00
|
|
|
component={TabMeListsList}
|
2021-02-08 23:19:55 +01:00
|
|
|
options={({ route, navigation }: any) => ({
|
2021-12-18 23:44:08 +01:00
|
|
|
title: t('me.stacks.list.name', { list: route.params.title }),
|
2021-02-08 23:19:55 +01:00
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
|
|
|
<HeaderCenter
|
2021-03-28 23:31:10 +02:00
|
|
|
content={t('me.stacks.list.name', {
|
2021-02-08 23:19:55 +01:00
|
|
|
list: route.params.title
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}),
|
|
|
|
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
<Stack.Screen
|
2021-05-09 21:59:03 +02:00
|
|
|
name='Tab-Me-Profile'
|
|
|
|
component={TabMeProfile}
|
|
|
|
options={{
|
2021-08-21 01:45:43 +02:00
|
|
|
headerShown: false,
|
|
|
|
presentation: 'modal'
|
2021-05-09 21:59:03 +02:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Stack.Screen
|
|
|
|
name='Tab-Me-Push'
|
|
|
|
component={TabMePush}
|
2021-05-12 22:45:51 +02:00
|
|
|
options={({ navigation }) => ({
|
2021-08-21 01:45:43 +02:00
|
|
|
presentation: 'modal',
|
2021-05-12 22:45:51 +02:00
|
|
|
headerShown: true,
|
2021-12-18 23:44:08 +01:00
|
|
|
title: t('me.stacks.push.name'),
|
2021-05-12 22:45:51 +02:00
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
|
|
|
<HeaderCenter content={t('me.stacks.push.name')} />
|
|
|
|
)
|
|
|
|
}),
|
|
|
|
headerLeft: () => (
|
|
|
|
<HeaderLeft
|
|
|
|
content='ChevronDown'
|
|
|
|
onPress={() => navigation.goBack()}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
})}
|
2021-02-08 23:19:55 +01:00
|
|
|
/>
|
2021-03-10 10:22:53 +01:00
|
|
|
<Stack.Screen
|
2021-05-09 21:59:03 +02:00
|
|
|
name='Tab-Me-Settings'
|
|
|
|
component={TabMeSettings}
|
2021-03-10 10:22:53 +01:00
|
|
|
options={({ navigation }: any) => ({
|
2021-12-18 23:44:08 +01:00
|
|
|
title: t('me.stacks.settings.name'),
|
2021-03-10 10:22:53 +01:00
|
|
|
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
|
|
|
})}
|
|
|
|
/>
|
2021-02-20 19:12:44 +01:00
|
|
|
<Stack.Screen
|
2021-05-09 21:59:03 +02:00
|
|
|
name='Tab-Me-Settings-Fontsize'
|
|
|
|
component={TabMeSettingsFontsize}
|
2021-02-20 19:12:44 +01:00
|
|
|
options={({ navigation }: any) => ({
|
2021-12-18 23:44:08 +01:00
|
|
|
title: t('me.stacks.fontSize.name'),
|
2021-02-20 19:12:44 +01:00
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
2021-05-09 21:59:03 +02:00
|
|
|
<HeaderCenter content={t('me.stacks.fontSize.name')} />
|
2021-02-20 19:12:44 +01:00
|
|
|
)
|
|
|
|
}),
|
|
|
|
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
|
|
|
})}
|
|
|
|
/>
|
2022-05-28 22:18:03 +02:00
|
|
|
<Stack.Screen
|
|
|
|
name='Tab-Me-Settings-Language'
|
|
|
|
component={TabMeSettingsLanguage}
|
|
|
|
options={({ navigation }: any) => ({
|
|
|
|
title: t('me.stacks.language.name'),
|
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
|
|
|
<HeaderCenter content={t('me.stacks.language.name')} />
|
|
|
|
)
|
|
|
|
}),
|
|
|
|
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
|
|
|
})}
|
|
|
|
/>
|
2021-02-08 23:19:55 +01:00
|
|
|
<Stack.Screen
|
|
|
|
name='Tab-Me-Switch'
|
2021-05-09 21:59:03 +02:00
|
|
|
component={TabMeSwitch}
|
2021-05-12 22:45:51 +02:00
|
|
|
options={({ navigation }) => ({
|
2021-08-21 01:45:43 +02:00
|
|
|
presentation: 'modal',
|
2021-05-12 22:45:51 +02:00
|
|
|
headerShown: true,
|
2021-12-18 23:44:08 +01:00
|
|
|
title: t('me.stacks.switch.name'),
|
2021-05-12 22:45:51 +02:00
|
|
|
...(Platform.OS === 'android' && {
|
|
|
|
headerCenter: () => (
|
|
|
|
<HeaderCenter content={t('me.stacks.switch.name')} />
|
|
|
|
)
|
|
|
|
}),
|
|
|
|
headerLeft: () => (
|
|
|
|
<HeaderLeft
|
|
|
|
content='ChevronDown'
|
|
|
|
onPress={() => navigation.goBack()}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
})}
|
2021-02-08 23:19:55 +01:00
|
|
|
/>
|
2020-11-21 13:19:05 +01:00
|
|
|
|
2021-08-29 15:25:38 +02:00
|
|
|
{TabSharedRoot({ Stack })}
|
2021-02-08 23:19:55 +01:00
|
|
|
</Stack.Navigator>
|
|
|
|
)
|
|
|
|
},
|
|
|
|
() => true
|
|
|
|
)
|
2020-11-21 13:19:05 +01:00
|
|
|
|
2021-01-30 01:29:15 +01:00
|
|
|
export default TabMe
|