import React, {Component} from 'react'
//these are the containers for this component
import OrderBoard from '../components/order-board';
import Banner from './banner';
import ConfirmationBox from '../components/confirmation-box';
import { browserHistory } from 'react-router';

//import css
import '../css/order/menu.css'

const io = require("socket.io-client");

/**
 * Order layout/board. This is also a dumb class (class only made for layout)
 * */
class Order extends Component {
    //The CategoryNavigation tag only shows whatever is in the CategoryNavigation class
    //same with others

    constructor() {
        super();
        this.closeStore = this.closeStore.bind(this);
    }
    socket = io();

    componentDidMount() {
        this.socket.on("close store", this.closeStore);
    }

    closeStore() {
        this.socket.removeListener("close store", this.closeStore);
        browserHistory.push("/")
    }

    render() {

        return (

            <div className="container-fluid transition-item enter-up-exit-down main">
                <ConfirmationBox/>
                <Banner/>
                <div className="container-fluid">
                    <OrderBoard/>
                </div>
            </div>

        )


    }
}

export default Order;
@@ -270,17 +270,149 @@
 outer';%0A
+import %7Bconnect%7D from 'react-redux';%0Aimport %7BremoveAllItem%7D from '../actions/order/index';%0Aimport %7BbindActionCreators%7D from 'redux';
 %0A
-
 //import
@@ -1010,24 +1010,60 @@
 loseStore);%0A
+        this.props.removeAllItem();%0A
         brow
@@ -1423,25 +1423,192 @@
 %0A%7D%0A%0A
-export default 
+function mapDispatchToProps(dispatch) %7B%0A    return bindActionCreators(%7B%0A        removeAllItem: removeAllItem%0A    %7D, dispatch);%0A%0A%7D%0A%0Aexport default connect(null, mapDispatchToProps)(
 Order
-;
+);%0A

fix bug orders were not cleared when restaurant closes