2020-11-24 00:18:47 +01:00
|
|
|
import React from 'react'
|
2020-10-24 18:07:09 +02:00
|
|
|
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
2020-10-23 09:22:17 +02:00
|
|
|
|
2020-12-13 14:04:25 +01:00
|
|
|
import Timeline from '@components/Timelines/Timeline'
|
|
|
|
import sharedScreens from '@screens/Shared/sharedScreens'
|
2020-11-24 00:18:47 +01:00
|
|
|
import { useSelector } from 'react-redux'
|
2020-12-13 14:04:25 +01:00
|
|
|
import { RootState } from '@root/store'
|
2020-11-29 13:11:23 +01:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2020-10-24 18:07:09 +02:00
|
|
|
|
|
|
|
const Stack = createNativeStackNavigator()
|
2020-10-23 09:22:17 +02:00
|
|
|
|
2020-11-21 13:19:05 +01:00
|
|
|
const ScreenNotifications: React.FC = () => {
|
2020-11-29 13:11:23 +01:00
|
|
|
const { t } = useTranslation()
|
2020-11-24 00:18:47 +01:00
|
|
|
const localRegistered = useSelector(
|
|
|
|
(state: RootState) => state.instances.local.url
|
|
|
|
)
|
2020-10-24 18:07:09 +02:00
|
|
|
|
|
|
|
return (
|
2020-11-29 13:11:23 +01:00
|
|
|
<Stack.Navigator
|
2020-11-30 00:24:53 +01:00
|
|
|
screenOptions={{ headerTitle: t('notifications:heading') }}
|
2020-11-29 13:11:23 +01:00
|
|
|
>
|
2020-11-24 00:18:47 +01:00
|
|
|
<Stack.Screen name='Screen-Notifications-Root'>
|
2020-12-13 21:09:21 +01:00
|
|
|
{() => (localRegistered ? <Timeline page='Notifications' /> : null)}
|
2020-10-24 18:07:09 +02:00
|
|
|
</Stack.Screen>
|
2020-10-30 20:03:44 +01:00
|
|
|
|
|
|
|
{sharedScreens(Stack)}
|
2020-10-24 18:07:09 +02:00
|
|
|
</Stack.Navigator>
|
|
|
|
)
|
2020-10-23 09:22:17 +02:00
|
|
|
}
|
2020-10-31 21:04:46 +01:00
|
|
|
|
2020-11-21 13:19:05 +01:00
|
|
|
export default ScreenNotifications
|