|
1 | 1 | /** |
2 | 2 | * TODO: Refactor codes |
3 | 3 | * |
4 | | - * TODO: Add code styles linting |
5 | | - * |
6 | 4 | */ |
7 | | -import React, { Component } from 'react'; |
8 | | -import { AppRegistry, StyleSheet, Text, View } from 'react-native'; |
9 | | -import Icon from 'react-native-vector-icons/Ionicons'; |
10 | | -import { Router, Scene, Schema, ActionConst } from 'react-native-router-flux'; |
| 5 | +import React from 'react'; |
| 6 | +import { Router, Scene, ActionConst } from 'react-native-router-flux'; |
| 7 | +import { setCustomTextInput } from 'react-native-global-props'; |
11 | 8 | import Splash from './containers/Splash'; |
12 | 9 | import Events from './containers/Events'; |
13 | 10 | import SingleEvent from './containers/SingleEvent'; |
14 | 11 | import Reserve from './containers/Reserve'; |
15 | 12 | import Comment from './containers/Comment'; |
16 | | -import { |
17 | | - setCustomView, |
18 | | - setCustomTextInput, |
19 | | - setCustomText, |
20 | | - setCustomImage, |
21 | | - setCustomTouchableOpacity |
22 | | -} from 'react-native-global-props'; |
23 | 13 |
|
24 | 14 | const customTextInputProps = { |
25 | 15 | underlineColorAndroid: 'rgba(0,0,0,0)', |
26 | 16 | }; |
| 17 | +setCustomTextInput(customTextInputProps); |
| 18 | +const App = () => ( |
| 19 | + <Router> |
| 20 | + <Scene key="root"> |
| 21 | + <Scene |
| 22 | + key="splash" |
| 23 | + component={Splash} |
| 24 | + hideNavBar="true" |
| 25 | + title="Splash" |
| 26 | + titleStyle={{ color: '#009688', fontSize: 18 }} |
| 27 | + navigationBarStyle={{ borderBottomWidth: 0 }} |
| 28 | + /> |
| 29 | + <Scene |
| 30 | + key="events" |
| 31 | + title="Events" |
| 32 | + component={Events} |
| 33 | + titleStyle={{ color: '#ffffff', fontSize: 18 }} |
| 34 | + navigationBarStyle={{ |
| 35 | + borderBottomWidth: 0, |
| 36 | + backgroundColor: 'rgba(25, 43, 62, 0.9)', |
| 37 | + }} |
| 38 | + animation="fade" |
| 39 | + type={ActionConst.RESET} |
| 40 | + /> |
| 41 | + <Scene |
| 42 | + key="event" |
| 43 | + title="Event details" |
| 44 | + hideNavBar |
| 45 | + component={SingleEvent} |
| 46 | + titleStyle={{ color: '#ffffff', fontSize: 18 }} |
| 47 | + navigationBarStyle={{ |
| 48 | + borderBottomWidth: 0, |
| 49 | + backgroundColor: 'rgba(25, 43, 62, 0.9)', |
| 50 | + }} |
| 51 | + animation="fade" |
| 52 | + /> |
| 53 | + <Scene |
| 54 | + key="reserve" |
| 55 | + title="Reserve" |
| 56 | + hideNavBar |
| 57 | + direction="vertical" |
| 58 | + component={Reserve} |
| 59 | + schema="modal" |
| 60 | + /> |
| 61 | + <Scene |
| 62 | + key="comment" |
| 63 | + title="Comment" |
| 64 | + hideNavBar |
| 65 | + renderBackButton={() => null} |
| 66 | + direction="vertical" |
| 67 | + component={Comment} |
| 68 | + schema="modal" |
| 69 | + /> |
| 70 | + </Scene> |
| 71 | + </Router> |
| 72 | +); |
27 | 73 |
|
28 | | -export default class App extends Component { |
29 | | - render() { |
30 | | - return ( |
31 | | - <Router> |
32 | | - <Scene key="root"> |
33 | | - <Scene |
34 | | - key="splash" |
35 | | - component={Splash} |
36 | | - hideNavBar="true" |
37 | | - title="Splash" |
38 | | - titleStyle={{ color: '#009688', fontSize: 18 }} |
39 | | - navigationBarStyle={{ borderBottomWidth: 0 }} |
40 | | - /> |
41 | | - <Scene |
42 | | - key="events" |
43 | | - title="Events" |
44 | | - component={Events} |
45 | | - titleStyle={{ color: '#ffffff', fontSize: 18 }} |
46 | | - navigationBarStyle={{ |
47 | | - borderBottomWidth: 0, |
48 | | - backgroundColor: 'rgba(25, 43, 62, 0.9)' |
49 | | - }} |
50 | | - animation="fade" |
51 | | - type={ActionConst.RESET} |
52 | | - /> |
53 | | - <Scene |
54 | | - key="event" |
55 | | - title="Event details" |
56 | | - hideNavBar={true} |
57 | | - component={SingleEvent} |
58 | | - titleStyle={{ color: '#ffffff', fontSize: 18 }} |
59 | | - navigationBarStyle={{ |
60 | | - borderBottomWidth: 0, |
61 | | - backgroundColor: 'rgba(25, 43, 62, 0.9)' |
62 | | - }} |
63 | | - animation="fade" |
64 | | - /> |
65 | | - <Scene |
66 | | - key="reserve" |
67 | | - title="Reserve" |
68 | | - hideNavBar={true} |
69 | | - direction="vertical" |
70 | | - component={Reserve} |
71 | | - schema="modal" |
72 | | - /> |
73 | | - <Scene |
74 | | - key="comment" |
75 | | - title="Comment" |
76 | | - hideNavBar={true} |
77 | | - renderBackButton={() => null} |
78 | | - direction="vertical" |
79 | | - component={Comment} |
80 | | - schema="modal" |
81 | | - /> |
82 | | - </Scene> |
83 | | - </Router> |
84 | | - ); |
85 | | - } |
86 | | -} |
87 | | - |
88 | | -const styles = StyleSheet.create({ |
89 | | - container: { |
90 | | - flex: 1, |
91 | | - justifyContent: 'center', |
92 | | - alignItems: 'center', |
93 | | - backgroundColor: '#F5FCFF' |
94 | | - }, |
95 | | - welcome: { |
96 | | - fontSize: 20, |
97 | | - textAlign: 'center', |
98 | | - margin: 10 |
99 | | - }, |
100 | | - instructions: { |
101 | | - textAlign: 'center', |
102 | | - color: '#333333', |
103 | | - marginBottom: 5 |
104 | | - } |
105 | | -}); |
| 74 | +export default App; |
0 commit comments