-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
61 lines (51 loc) · 1.84 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
58
59
60
61
import { RobotoCondensed_300Light, RobotoCondensed_400Regular } from '@expo-google-fonts/roboto-condensed';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { NavigationContainer } from '@react-navigation/native';
import { Footer } from 'components/Footer';
import { colors } from 'constants/colors';
import { pathConfig } from 'constants/pathConfig';
import { useFonts } from 'expo-font';
import React from 'react';
import { HomeScreen } from 'screens/HomeScreen';
import { MultiMatchScreen } from 'screens/MultiMatchScreen';
const Tab = createMaterialTopTabNavigator();
function getInitialRouteName() {
const pathname = window.location.pathname
if (pathname === pathConfig.MULTI_MATCH) {
return 'Multi Match'
}
}
export default function App() {
let [fontsLoaded] = useFonts({
RobotoCondensed_300Light,
RobotoCondensed_400Regular
});
if (!fontsLoaded) {
return null;
}
return (
<NavigationContainer>
<Tab.Navigator sceneContainerStyle={styles.scene} initialRouteName={getInitialRouteName()}
screenOptions={{
tabBarLabelStyle: { fontSize: 12, color: 'white' },
tabBarItemStyle: { width: 200 },
tabBarStyle: { backgroundColor: colors.topBar },
tabBarIndicatorStyle: { backgroundColor: 'white' },
swipeEnabled: false
}}>
<Tab.Screen name="Single Match" component={HomeScreen} />
<Tab.Screen name="Multi Match" component={MultiMatchScreen} />
</Tab.Navigator>
<Footer />
</NavigationContainer>
)
}
const styles = {
scene: {
paddingTop: 10,
backgroundColor: 'white'
},
tabContainer: {
backgroundColor: 'red'
}
}