-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
75 lines (66 loc) · 2.4 KB
/
App.js
File metadata and controls
75 lines (66 loc) · 2.4 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { StyleSheet, Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { RegisterScreen, LoginScreen ,HomeScreen , AddChatScreen, ChatScreen, VideoScreen} from './screens';
import { PermissionsAndroid, Platform } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { useEffect } from 'react';
import { TamaguiProvider, Theme } from 'tamagui'
import { tamaguiConfig } from './tamagui.config'
import { BottomTabsNavigator,DrawerMenu } from './components';
import { DataProvider, UserProvider } from './context';
const Stack = createNativeStackNavigator();
const Drawer = createDrawerNavigator();
const globalScreenOptions = {
headerStyle: { backgroundColor: "#381fd1" },
headerTitleStyle: {color: "white"},
headerTintColor: "white",
};
const DrawerNavigator = () => (
<Drawer.Navigator drawerContent={props => <DrawerMenu {...props} />}>
<Drawer.Screen name="All" component={BottomTabsNavigator} options={{ headerShown: false }} />
<Drawer.Screen name='Chat' component={ChatScreen} />
<Drawer.Screen name='Video' component={VideoScreen} />
</Drawer.Navigator>
);
export default function App() {
useEffect(() => {
const run = async () => {
if (Platform.OS === 'android') {
await PermissionsAndroid.requestMultiple([
'android.permission.POST_NOTIFICATIONS',
'android.permission.BLUETOOTH_CONNECT',
]);
}
};
run();
}, []);
return (
<UserProvider>
<DataProvider>
<TamaguiProvider config={tamaguiConfig} >
<Theme name="light">
<NavigationContainer>
<Stack.Navigator
// initialRouteName='Home'
screenOptions={globalScreenOptions}
>
<Stack.Screen name='Login' component={LoginScreen} />
<Stack.Screen name='Register' component={RegisterScreen} />
<Stack.Screen name='Main' component={DrawerNavigator} options={{ headerShown: false }} />
</Stack.Navigator>
</NavigationContainer>
</Theme>
</TamaguiProvider>
</DataProvider>
</UserProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});