-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
57 lines (53 loc) · 1.81 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
45
46
47
48
49
50
51
52
53
54
55
56
57
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import LoginScreen from './screens/loginScreen';
import HomeScreen from './screens/homeScreen';
import RegisterScreen from './screens/registerScreen';
import {RootStackParamList} from './navigation';
import {SafeAreaView, useColorScheme} from 'react-native';
import {Colors} from 'react-native/Libraries/NewAppScreen';
import Dialog from './dialogs/dialog';
import {QueryClient, QueryClientProvider} from 'react-query';
import {useTranslate} from './languages/translations';
const Stack = createNativeStackNavigator<RootStackParamList>();
const App = () => {
const {t} = useTranslate();
const isDarkMode = useColorScheme() === 'dark';
const queryClient = new QueryClient();
const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
flex: 1,
};
return (
<QueryClientProvider client={queryClient}>
<SafeAreaView style={backgroundStyle}>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name={'Login'}
options={{
title: `${t('LOGIN_TITLE')}`,
}}
component={LoginScreen}
/>
<Stack.Screen
name="Register"
options={{
title: `${t('REGISTER_TITLE')}`,
}}
component={RegisterScreen}
/>
<Stack.Screen
options={{headerShown: false, title: `${t('HOME_TITLE')}`}}
name="Home"
component={HomeScreen}
/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaView>
<Dialog />
</QueryClientProvider>
);
};
export default App;