-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathindex.js
More file actions
62 lines (53 loc) · 1.33 KB
/
index.js
File metadata and controls
62 lines (53 loc) · 1.33 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 {connect} from 'react-redux'
import {
View,
Text
} from 'react-native'
import appStyles from '../../styles/app';
import List from '../../components/List/List'
import GetRemote from './Demos/GetRemote';
export const Routes = {
'get_config': {
route: {
title: 'Get remote config',
Component: GetRemote
}
}
}
console.log(GetRemote)
export class RemoteConfig extends React.Component {
render() {
const initialRows = Object.keys(Routes).map(key => {
const routeCfg = Routes[key];
return { title: routeCfg.route.title, key: `remoteConfig.${key}` }
})
return (
<View style={appStyles.container}>
<List
initialRows={initialRows}
renderRow={this._renderRow.bind(this)}
onRowPress={this._onRowPress.bind(this)}
/>
</View>
)
}
_renderRow(rowData, sectionID, rowID, highlightRow) {
console.log(rowData)
return (
<View style={[appStyles.row]}>
<Text>{rowData.title}</Text>
</View>
)
}
_onRowPress(rowData) {
const rowKey = rowData.key;
const {actions} = this.props;
const {navigation} = actions;
navigation.push(rowKey, this.props);
}
}
const mapStateToProps = (state) => ({
firestack: state.firestack
})
export default connect(mapStateToProps)(RemoteConfig)