-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
44 lines (38 loc) · 1.27 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
42
43
44
import { StyleSheet, View, SafeAreaView } from 'react-native';
import { NativeRouter, Routes, Route } from 'react-router-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { Colors } from './colors';
import { authService } from './services';
import { Auth } from './pages';
export default function App() {
/*
const [fontsLoaded] = Font.useFonts({
'JosefinSans-Regular': require('./assets/fonts/JosefinSans-Regular.ttf'),
});
*/
const { path } = this.props.match;
return (
<SafeAreaProvider>
<View style={styles.container}>
<NativeRouter>
<Routes>
<Redirect from='/' to={authService.isLoggedIn() ? '/tabs' : '/auth'} />
<Route path={`${path}/auth`} element={<Auth />} />
<Route path={`${path}/tabs`} element={<Tabs />} />
</Routes>
</NativeRouter>
</View>
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: {
backgroundColor: Colors.background,
color: Colors.foreground,
alignItems: 'center',
justifyContent: 'center',
},
text: {
color: Colors.foreground,
},
});