OutOfStockContainer.js 1.48 KB

'use strict';

import React, { Component } from 'react';
import Immutable, {List, Record} from 'immutable';
import OutOfStock from '../components/OutOfStock/OutOfStock'

import {
    StyleSheet,
    View,
    Text,
    ListView,
    Dimensions,
    Platform,
} from 'react-native';

import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';

import {Map} from 'immutable';

import * as outOfStockActions from '../reducers/outOfStock/outOfStockActions';

const actions = [
    outOfStockActions,
];


function mapStateToProps(state) {
    return {
        ...state
    }
};

function mapDispatchToProps(dispatch) {

    const creators = Map()
            .merge(...actions)
            .filter(value => typeof value === 'function')
            .toObject();

    return {
        actions: bindActionCreators(creators, dispatch),
        dispatch
    };
}

class OutOfStockContainer extends Component {

	constructor(props) {
		super(props);
	}

	componentDidMount() {

	}

    componentWillUnmount() {

    }

	render() {
		return (
			<View style={styles.container}>
                <OutOfStock />
			</View>
		);
	}
}

let {width, height} = Dimensions.get('window');
let navbarHeight = (Platform.OS === 'android') ? 50 : 64;

let styles = StyleSheet.create({
    container: {
        top: navbarHeight,
        height: height - navbarHeight,
        paddingBottom: (Platform.OS === 'android') ? 24 : 0,
    },

});

export default connect(mapStateToProps, mapDispatchToProps)(OutOfStockContainer);