tooot/src/screens/Notifications.tsx

35 lines
997 B
TypeScript
Raw Normal View History

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'
import PleaseLogin from '@components/PleaseLogin'
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 = () => {
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 (
<Stack.Navigator
2020-11-30 00:24:53 +01:00
screenOptions={{ headerTitle: t('notifications:heading') }}
>
2020-11-24 00:18:47 +01:00
<Stack.Screen name='Screen-Notifications-Root'>
{() =>
localRegistered ? <Timeline page='Notifications' /> : <PleaseLogin />
}
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