RedPersonBrand.js 1.48 KB
'use strict';

import React from 'react';
import ReactNative, {
	AppRegistry,
	Platform,
	StyleSheet,
	Dimensions,
	TouchableOpacity,
} from 'react-native';

import {
	Provider,
	connect
} from 'react-redux';

import configureStore from './store/configureStore';
import {Record, List, Map} from 'immutable';

import appInitialState from './reducers/app/appInitialState';
import redBrandInitialState from './reducers/redBrand/redBrandInitialState';

import RedPersonBrandContainer from './containers/RedPersonBrandContainer';

import {
	setPlatform,
	setHost,
	setSingleApiHost,
	setliveHost,
} from './reducers/app/appActions';

import {
	setShopId,
} from './reducers/redBrand/redBrandActions';

function getInitialState() {
	const _initState = {
		app: (new appInitialState()),
    	redBrand: (new redBrandInitialState()),
	};
	return _initState;
}

export default function native(platform) {

	let YH_RedPersonBrandView = React.createClass({

		render() {
		  	const store = configureStore(getInitialState());
			store.dispatch(setPlatform(platform));
			let {storeId, host,singleApiHost,liveHost} = this.props;
			store.dispatch(setHost(host));
			store.dispatch(setShopId(storeId));
			store.dispatch(setSingleApiHost(singleApiHost));
			store.dispatch(setliveHost(liveHost));

			return (
				<Provider store={store}>
					<RedPersonBrandContainer />
				</Provider>
			);
		}
	});

	AppRegistry.registerComponent('YH_RedPersonBrandView', () => YH_RedPersonBrandView);
}

let styles = StyleSheet.create({

});