-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
52 lines (50 loc) · 1.44 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
import 'react-native-gesture-handler'
import React from 'react'
import {
createDrawerNavigator,
} from '@react-navigation/drawer'
import { View, Image } from 'react-native'
import { NavigationContainer } from '@react-navigation/native'
import Webcam from './components/Webcam'
import Home from './components/Home'
import { styles } from './style/style'
const Drawer = createDrawerNavigator()
const App = () => (
<NavigationContainer>
<Drawer.Navigator
initialRouteName="Home"
drawerType="front"
drawerStyle={styles.drawer}
drawerContentOptions={{
itemStyle: {
marginVertical: 20,
flexDirection: 'row',
},
}}
>
<Drawer.Screen
name="Ettäisyys"
component={Home}
options={{
drawerIcon: () => (
<View style={{ width: 170, height: 170 }}>
<Image style={{ flex: 1, width: undefined, height: undefined }} source={require('./assets/icon1.png')} />
</View>
),
}}
/>
<Drawer.Screen
name="Kauppatori"
component={Webcam}
options={{
drawerIcon: () => (
<View style={{ width: 170, height: 170 }}>
<Image style={{ flex: 1, width: undefined, height: undefined }} source={require('./assets/ToripolliisiCropped.png')} />
</View>
),
}}
/>
</Drawer.Navigator>
</NavigationContainer>
)
export default App