-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
93 lines (90 loc) · 2.09 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
import React from 'react';
import {View, StyleSheet, Platform} from 'react-native';
import {createAppContainer} from 'react-navigation';
import {createBottomTabNavigator} from 'react-navigation-tabs';
import Ble from './components/Ble.js';
import QR from './components/QR.js';
import Icon from './components/Icon';
const styles = StyleSheet.create({
Logo: {
position: 'absolute',
bottom: Platform.OS === 'ios' ? 47 : 12,
zIndex: 1,
display: 'flex',
alignSelf: 'center',
shadowColor: 'black',
shadowOffset: {width: 0, height: 10},
shadowOpacity: 0.1,
shadowRadius: 11,
elevation: 50,
backgroundColor: 'white',
borderRadius: 100,
width: 76,
height: 76,
},
ViewContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
TabBar: {
paddingTop: Platform.OS === 'ios' ? 40 : 16,
},
});
class BLEScreen extends React.Component {
render() {
return (
<View style={styles.ViewContainer}>
<Ble />
</View>
);
}
}
class QRScreen extends React.Component {
render() {
return (
<View style={styles.ViewContainer}>
<QR />
</View>
);
}
}
const AppContainer = createAppContainer(
createBottomTabNavigator(
{
Ble: BLEScreen,
Qr: QRScreen,
},
{
defaultNavigationOptions: ({navigation}) => ({
tabBarIcon: ({focused, horizontal, tintColor}) => {
const {routeName} = navigation.state;
let svgName;
if (routeName === 'Ble') {
svgName = 'Ble';
} else if (routeName === 'Qr') {
svgName = 'Qr';
}
return (
<View style={styles.TabBar}>
<Icon name={svgName} fill={tintColor} />
</View>
);
},
}),
tabBarOptions: {
showLabel: false,
activeTintColor: '#009AFF',
inactiveTintColor: '#CFCFCF',
},
},
),
);
export default () => (
<View style={{flex: 1}}>
<View style={styles.Logo}>
<Icon name="Logo2" width="80" height="80" />
</View>
<AppContainer />
</View>
);