tooot/src/screens/Notifications.tsx

31 lines
895 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-11-23 00:07:32 +01:00
import Timeline from 'src/components/Timelines/Timeline'
2020-11-21 13:19:05 +01:00
import sharedScreens from 'src/screens/Shared/sharedScreens'
2020-11-24 00:18:47 +01:00
import { useSelector } from 'react-redux'
import { RootState } from 'src/store'
import PleaseLogin from 'src/components/PleaseLogin'
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-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-24 00:18:47 +01:00
<Stack.Navigator screenOptions={{ headerTitle: '通知' }}>
<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