This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
165 lines (151 loc) · 3.22 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import React, { Component } from 'react';
import {
StyleSheet,
} from 'react-native';
import {
MaterialTopTabBar,
SafeAreaView,
createAppContainer,
createMaterialTopTabNavigator,
} from 'react-navigation';
import {Header, Icon} from 'react-native-elements';
import {Rules} from './components/rules'
import {Norminette} from './components/norminette'
import {UnitTests} from './components/unitTests'
import {Settings} from './components/settings'
import * as Constants from "react-native-paper";
class App extends Component {
render() {
return (
<React.Fragment>
<Header
leftComponent={{ text: 'EpiBuild', style: {
color: 'gray',
marginLeft:10,
fontSize: 22,
width: 100
}}}
rightComponent={{ icon: 'home', color: 'gray' }}
containerStyle={{
backgroundColor:'#f8f8f8',
alignItems: 'center',
elevation: 25,
}}
/>
<AppContainer/>
</React.Fragment>
);
}
}
const stylesHeader = StyleSheet.create({
container: {
flex: 1,
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
},
});
export default App;
class MaterialTopTabBarWrapper extends React.Component {
render() {
const { index } = this.props.navigationState;
const color =
index === 0 ? "#fc929e" : index === 1 ? "#79b6f2" : index === 2 ? "#8dc891" : "#fac863";
return (
<SafeAreaView
forceInset={{ top: 'never', horizontal: 'never', bottom: 'never' }}>
<MaterialTopTabBar
{...this.props}
activeTintColor={color}
indicatorStyle={{ backgroundColor: color, top:0 }}
style={{ backgroundColor: "#fff" }}
inactiveTintColor={'gray'}
/>
</SafeAreaView>
);
}
}
let actualColor = '#FF1493';
let Tabs = createMaterialTopTabNavigator(
{
Rules: {
screen: Rules,
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ tintColor }) => {
return <Icon
name='ios-hammer'
type='ionicon'
color='#000000'
/>
},
}),
showIcon: true
},
Norminette: {
screen: Norminette,
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ tintColor }) => {
return <Icon
name='ios-code'
type='ionicon'
color='#000000'
/>
},
}),
showIcon: true
},
'Unit Tests': {
screen: UnitTests,
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ tintColor }) => {
return <Icon
name='ios-flask'
type='ionicon'
color='#000000'
/>
},
}),
showIcon: true
},
Settings: {
screen: Settings,
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ tintColor }) => {
return <Icon
name='ios-settings'
type='ionicon'
color='#000000'
/>
},
}),
showIcon: true
},
},
{
showIcon: true,
tabBarPosition: 'bottom',
tabBarOptions: {
pressColor: '#F5F5F5',
showIcon: true,
activeTintColor: '#000',
inactiveTintColor: '#696969',
style: {
backgroundColor: '#fff',
},
indicatorStyle: {
backgroundColor: actualColor,
},
},
tabBarComponent: MaterialTopTabBarWrapper,
}
);
const AppContainer = createAppContainer(Tabs);
let styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
paragraph: {
fontSize: 18,
},
});