Haggle.js
1.31 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
'use strict';
import React from 'react';
import {AppRegistry} from 'react-native';
import createReactClass from 'create-react-class';
import {Provider} from 'react-redux';
import configureStore from './store/configureStore';
import haggleInitialState from './reducers/haggleListReducer/haggleInitialState';
import appInitialState from './reducers/app/appInitialState';
import HaggleListContainer from './containers/HaggleListContainer';
import {setHost, setPlatform, setServiceHost} from './reducers/app/appActions';
function getInitialState() {
const _initState = {
app: (new appInitialState()),
haggle: (new haggleInitialState()),
};
return _initState;
}
export default function native(platform) {
let YH_HaggleProductList = createReactClass({
render() {
const store = configureStore(getInitialState());
store.dispatch(setPlatform(platform));
store.dispatch(setHost(this.props.host));
store.dispatch(setServiceHost(this.props.serviceHost));
let type = this.props.type;
return (
<Provider store={store}>
<HaggleListContainer/>
</Provider>
);
}
});
AppRegistry.registerComponent('YH_HaggleProductList', () => YH_HaggleProductList);
}