-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
41 lines (36 loc) · 1.02 KB
/
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
41
import React, {useEffect} from 'react';
import {
DefaultTheme,
NavigationContainer,
Theme,
} from '@react-navigation/native';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import GetStarted from './src/screens/GetStarted';
import {useStore} from './src/store/storage';
import {COLORS} from './src/styles';
import AuthenticatedNavigation from './src/navigation/AuthenticatedNavigation';
import {getTeams} from './src/api/teams/getTeams';
const theme: Theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
background: COLORS.dark,
border: '#38383A',
},
};
function App(): JSX.Element {
const {drinker, setTeams} = useStore();
useEffect(() => {
//fetch more data here
const fetchTeams = async () => setTeams(await getTeams());
fetchTeams();
}, [setTeams]);
return (
<SafeAreaProvider>
<NavigationContainer theme={theme}>
{drinker ? <AuthenticatedNavigation /> : <GetStarted />}
</NavigationContainer>
</SafeAreaProvider>
);
}
export default App;