-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
66 lines (58 loc) · 1.93 KB
/
App.js
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
import Constants from 'expo-constants';
import React from 'react';
import WelcomeScreen from './src/screens/WelcomeScreen';
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';
import AppLoading from 'expo-app-loading';
import { useFonts } from '@expo-google-fonts/inter';
import Icon from 'react-native-vector-icons/MaterialIcons';
import TeacherScreen from './src/screens/TeacherScreen';
import StudentScreen from './src/screens/StudentScreen';
import { NavigationContainer } from '@react-navigation/native';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { useHeaderHeight } from '@react-navigation/stack';
const Tab = createMaterialTopTabNavigator();
export default function App() {
const [fontsLoaded] = useFonts({
'Poppins-Regular': require('./assets/fonts/Poppins-Regular.ttf'),
'Poppins-Bold': require('./assets/fonts/Poppins-Bold.ttf'),
});
const [isReady, setIsReady] = React.useState(false);
const [selectedTab, setSelectedTab] = React.useState('Teacher');
if (!fontsLoaded || !isReady) {
return (
<AppLoading
startAsync={loadFonts}
onFinish={() => setIsReady(true)}
onError={console.warn}
/>
);
}
function loadFonts() {
// Your code to load fonts
}
return (
<NavigationContainer>
<Tab.Navigator
initialRouteName="Teacher"
tabBarOptions={{
activeTintColor: '#e91e63',
labelStyle: {
fontSize: 16,
fontFamily: 'Poppins-Bold',
},
indicatorStyle: {
backgroundColor: '#e91e63',
},
style: {
backgroundColor: '#fff',
elevation: 0,
shadowOpacity: 0,
},
}}
>
<Tab.Screen name="Teacher" component={TeacherScreen} />
<Tab.Screen name="Student" component={StudentScreen} />
</Tab.Navigator>
</NavigationContainer>
);
}