mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
34 lines
688 B
React
34 lines
688 B
React
|
import React, { Component, PropTypes } from 'react';
|
||
|
import { connect } from 'react-redux';
|
||
|
import SidePanel from '../../components/SidePanel';
|
||
|
|
||
|
export class CoreLayout extends Component {
|
||
|
static propTypes = {
|
||
|
children: PropTypes.node,
|
||
|
dispatch: PropTypes.func,
|
||
|
user: PropTypes.object,
|
||
|
};
|
||
|
|
||
|
render () {
|
||
|
const { children, user } = this.props;
|
||
|
|
||
|
if (!user) return false;
|
||
|
|
||
|
return (
|
||
|
<div>
|
||
|
<SidePanel user={user} />
|
||
|
<div style={{ marginLeft: '240px' }}>{children}</div>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const mapStateToProps = (state) => {
|
||
|
const { user } = state.auth;
|
||
|
|
||
|
return { user };
|
||
|
};
|
||
|
|
||
|
export default connect(mapStateToProps)(CoreLayout);
|
||
|
|