-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
74 lines (68 loc) · 1.71 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {Component} from 'react';
import {TouchableOpacity,Text} from 'react-native';
import{Router,Scene,Stack,Actions} from 'react-native-router-flux'
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import ReduxThunk from 'redux-thunk';
import logger from 'redux-logger'
import Main from './Components/Main';
import Input from './Components/Input';
import reducers from './Reducers';
export default class App extends Component {
renderRight(){
return(
<TouchableOpacity>
<Text onPress={()=>Actions.input({type:'push'})} style={{ marginRight:5, color: '#8a2be2' }}>Add Item</Text>
</TouchableOpacity>
)
}
render() {
const store=createStore(reducers,{},applyMiddleware(ReduxThunk,logger));
return (
<Provider store={store}>
<Router
navigationBarstyle={styles.navBar} titleStyle={styles.textStyle}>
<Stack key="root">
<Scene
key="main"
component={Main}
title="TODO LİST"
initial
renderRightButton={this.renderRight()}
/>
<Scene
key="input"
component={Input}
title="ADD LİST"
/>
</Stack>
</Router>
</Provider>
);
}
}
const styles = {
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
navBar: {
backgroundColor: '#f8f8ff',
borderBottomWidth: 2,
borderColor: '#8a2be2',
borderRadius: 10,
},
textStyle:{
color: 'black',
fontWeight: 'bold',
fontSize: 20
}
};