-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
40 lines (37 loc) · 963 Bytes
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from 'react';
import {SafeAreaView, StyleSheet, View} from 'react-native';
import NotLoggedIn from './src/views/NotLoggedIn';
import MainApp from './src/views/MainApp';
import {observer} from 'mobx-react';
import appStore from './src/store/app';
import popoutStore from './src/store/popouts';
import colors from './src/colors.json';
const App = () => {
return (
<SafeAreaView style={styles.container}>
<Contents />
<Popouts />
</SafeAreaView>
);
};
const Contents = observer(() => (
<View>
{appStore.token === null && <NotLoggedIn />}
{appStore.token && <MainApp />}
</View>
));
const Popouts = observer(() => {
return (
<>
{Object.values(popoutStore.popouts).map(popout => (
<popout.component {...popout.data} key={popout.id} id={popout.id} />
))}
</>
);
});
export default App;
const styles = StyleSheet.create({
container: {
backgroundColor: colors.background,
},
});