-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
101 lines (96 loc) · 2.82 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* eslint-disable prettier/prettier */
/* eslint-disable react-native/no-inline-styles */
import React from 'react';
import {
View,
SafeAreaView,
Image,
Platform,
StatusBar,
} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import {
createDrawerNavigator,
DrawerContentScrollView,
DrawerItemList,
} from '@react-navigation/drawer';
import {widthPercentageToDP as wp, heightPercentageToDP as hp} from 'react-native-responsive-screen';
import GermanPage from './src/components/Page/GermanPage';
import EnglishPage from './src/components/Page/EnglishPage';
import WelcomePage from './src/components/Page/WelcomePage';
import ImprintPage from './src/components/Page/ImprintPage';
const Drawer = createDrawerNavigator();
function CustomDrawerContent(props) {
return (
<SafeAreaView style={{flex: 1}}>
<StatusBar translucent backgroundColor="#ed6b0b"/>
<View style={{flex: 0.5, height: hp('30%'), backgroundColor: '#d2d2d2', opacity: 0.9}}>
<Image
source={require('./src/assets/logo-weiss-2.png')}
style={{
top: hp('10%'),
height: hp('10%'),
...Platform.select({
ios: {
width: wp('33%'),
},
android: {
width: wp('38%'),
},
}),
alignSelf: 'center',
overflow: 'visible',
}}
/>
</View>
<DrawerContentScrollView {...props}>
<DrawerItemList {...props} />
</DrawerContentScrollView>
</SafeAreaView>
);
}
function MyDrawer() {
return (
<Drawer.Navigator
initialRouteName="Info"
drawerPosition="left"
drawerType="front"
drawerContent={props => CustomDrawerContent(props)}
drawerContentOptions={{
activeTintColor: '#D80070',
inactiveTintColor: '#005E6F',
labelStyle: {
left: wp('3%'),
fontSize: wp('4.5%'),
...Platform.select({
ios: {
fontFamily: 'Boton',
fontStyle: 'normal',
fontWeight: '400',
},
android: {
fontFamily: 'Boton-Regular',
},
}),
},
itemStyle: { height: hp('6%')},
}}
drawerStyle={{
backgroundColor: '#ed6b0b',
width: wp('70%'),
}}>
<Drawer.Screen name="Info" component={WelcomePage} />
<Drawer.Screen name="German To English" component={GermanPage} />
<Drawer.Screen name="English To German" component={EnglishPage} />
<Drawer.Screen name="Imprint" component={ImprintPage} />
</Drawer.Navigator>
);
}
export default function App() {
console.disableYellowBox = true;
return (
<NavigationContainer>
<MyDrawer />
</NavigationContainer>
);
}