tooot/src/screens/Me/Root.tsx

27 lines
683 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'
import { getLocalUrl } from 'src/utils/slices/instancesSlice'
2020-11-21 13:19:05 +01:00
import Login from './Root/Login'
2020-11-22 00:46:23 +01:00
import MyInfo from './Root/MyInfo'
2020-11-29 18:08:31 +01:00
import Collections from './Root/Collections'
2020-11-22 00:46:23 +01:00
import Settings from './Root/Settings'
2020-11-24 00:18:47 +01:00
import Logout from './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