-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathApp.js
More file actions
62 lines (56 loc) · 1.6 KB
/
App.js
File metadata and controls
62 lines (56 loc) · 1.6 KB
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
import React from 'react';
import { View, Text, Button, Modal } from 'react-native';
import { StackNavigator, TabNavigator, DrawerNavigator, addNavigationHelpers } from 'react-navigation';
import Storage from './src/utils/storage.js'
import { connect } from 'react-redux';
import { AppNavigator } from './src/constant/routers.js'
import { Provider } from 'react-redux'
import configureStore from './src/store/store'
import { Root } from "native-base";
var _ = require('lodash');
const store = configureStore();
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
showWelcome: false
}
Storage.get('FIRSTINIT').then(value => {
this.setState({
showWelcome: !value
})
})
Text.prototype.render = _.wrap(Text.prototype.render, function (func, ...args) {
let originText = func.apply(this, args);
return React.cloneElement(originText, {
style: [
originText.props.style,
{
allowFontScaling: false,
color: 'brown',
suppressHighlighting: true
}
]
});
});
}
render() {
// const {showWelcome} = this.state
return (
<Root>
<Provider store={store}>
<AppNavigator
navigation={addNavigationHelpers({
dispatch: this.props.dispatch,
state: this.props.nav
})}
ref={nav => this.navigator = nav} />
</Provider>
</Root>
)
}
}
const mapStateToProps = (state) => ({
nav: state.nav
});
export default connect(mapStateToProps)(App);