-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
51 lines (48 loc) · 1.71 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
import Home from './components/Home';
import Gameboard from './components/Gameboard';
import Scoreboard from './components/Scoreboard';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
const Tab = createBottomTabNavigator();
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator
// initialRouteName="Home"
sceneContainerStyle={{backgroundColor: 'transparent'}}
screenOptions={({ route }) => ({
tabBarIcon: ({focused, color, size}) => {
let iconName;
if (route.name === 'Home') {
iconName = focused
? 'information'
: 'information-outline'
}
else if (route.name === 'Gameboard') {
iconName = focused
? 'dice-multiple'
: 'dice-multiple-outline'
}
else if (route.name === 'Scoreboard') {
iconName = focused
? 'view-list'
: 'view-list-outline'
}
return <MaterialCommunityIcons
name={iconName}
size={size}
color={color}
/>
},
tabBarActiveTintColor: 'steelblue',
tabBarInactiveTintColor: 'grey'
})}
>
<Tab.Screen name="Home" component={Home} options={{tabBarStyle: {display: 'none'}}}/>
<Tab.Screen name="Gameboard" component={Gameboard} />
<Tab.Screen name="Scoreboard" component={Scoreboard} />
</Tab.Navigator>
</NavigationContainer>
);
}