import React from 'react';
import injectTapEventPlugin from 'react-tap-event-plugin';

import { connect }            from 'react-redux';
import {bindActionCreators} from 'redux';
import {NavBar} from 'components';
import 'styles/core.less';


class CoreLayout extends React.Component {

   static propTypes = {
    children : React.PropTypes.element,
    location : React.PropTypes.object
  }

  constructor (props) {
    super(props);
    // console.log(this.props);
    this.state = {
      prevLocation: ''
    };
  }



  componentDidMount () {
    injectTapEventPlugin();
  }

  render () {
    return (
      <div className='page-container'>
        <NavBar />
        <div className='view-container'>

          <div className='menu-bar'>
          </div>
          <div className='container'>
            {React.cloneElement(this.props.children, {prevLocation: this.state.prevLocation})}
          </div>
        </div>
      </div>
    );
  }
}


export default connect()(CoreLayout);
