tooot/src/screens/Me/Root.tsx

27 lines
730 B
TypeScript
Raw Normal View History

2020-11-21 13:19:05 +01:00
import React from 'react'
2020-11-22 00:46:23 +01:00
import { ScrollView } from 'react-native'
2020-11-21 13:32:29 +01:00
import { useSelector } from 'react-redux'
2020-12-13 14:04:25 +01:00
import { getLocalUrl } from '@utils/slices/instancesSlice'
2020-11-21 13:19:05 +01:00
2020-12-13 14:04:25 +01:00
import Login from '@screens/Me/Root/Login'
import MyInfo from '@screens/Me/Root/MyInfo'
import Collections from '@screens/Me/Root/Collections'
import Settings from '@screens/Me/Root/Settings'
import Logout from '@screens/Me/Root/Logout'
2020-11-21 13:19:05 +01:00
const ScreenMeRoot: React.FC = () => {
const localRegistered = useSelector(getLocalUrl)
2020-11-21 13:19:05 +01:00
2020-11-22 00:46:23 +01:00
return (
<ScrollView>
{localRegistered ? <MyInfo /> : <Login />}
2020-11-29 18:08:31 +01:00
{localRegistered && <Collections />}
2020-11-22 00:46:23 +01:00
<Settings />
2020-11-24 00:18:47 +01:00
{localRegistered && <Logout />}
2020-11-22 00:46:23 +01:00
</ScrollView>
)
2020-11-21 13:19:05 +01:00
}
export default ScreenMeRoot