Classify.js 1.27 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 classifyInitialState from './reducers/classify/classifyInitialState';

import ClassifyContainer from './containers/ClassifyContainer';

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

import {
	setType,
} from './reducers/classify/classifyActions';

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

export default function native(platform) {

	let YH_Classify = React.createClass({

		render() {
		  	const store = configureStore(getInitialState());
			store.dispatch(setPlatform(platform));
			store.dispatch(setHost(this.props.host));
			store.dispatch(setType(this.props.type));
			
			return (
				<Provider store={store}>
					<ClassifyContainer />
				</Provider>
			);
		}
	});

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

let styles = StyleSheet.create({

});