-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
81 lines (68 loc) · 2.01 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
import React from 'react'
import ReactDOM from 'react-dom'
import {Provider} from 'react-redux'
import { StyleSheet, Text, View } from 'react-native';
import { NativeRouter, Route, Link } from 'react-router-native'
import { PrivateRoute } from './utils/components/private-route'
import Carte from './carte/components/carte_screen'
import Home from './home/components/home_screen'
import Ranking from './ranking/components/ranking_screen'
import Voting from './voting/components/voting_screen'
import store from './store/configureStore'
export default class App extends React.Component {
componentDidMount() {
}
render() {
return (
<Provider store={store}>
<NativeRouter>
<View style={styles.container}>
<View style={styles.nav}>
<Link to="/" underlayColor='#f0f4f7' style={styles.navItem}>
<Text>Bem vindo</Text>
</Link>
<Link to="/carte" underlayColor='#f0f4f7' style={styles.navItem}>
<Text>Cardapio</Text>
</Link>
<Link to="/ranking" underlayColor='#f0f4f7' style={styles.navItem}>
<Text>Ranking</Text>
</Link>
<Link to="/voting" underlayColor='#f0f4f7' style={styles.navItem} >
<Text>Votar</Text>
</Link>
</View>
<Route exact path="/" component={Home}/>
<PrivateRoute path="/carte" component={Carte}/>
<PrivateRoute path="/ranking" component={Ranking}/>
<PrivateRoute path="/voting" component={Voting}/>
</View>
</NativeRouter>
</Provider>
);
}
}
const styles = StyleSheet.create({
container: {
marginTop: 25,
padding: 10,
},
header: {
fontSize: 20,
},
nav: {
flexDirection: 'row',
justifyContent: 'space-around'
},
navItem: {
flex: 1,
alignItems: 'center',
padding: 10,
},
subNavItem: {
padding: 5,
},
topic: {
textAlign: 'center',
fontSize: 15,
}
});