mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
bba69412b9
* admin layout component * Admin Dashboard page * styleguide * AdminSidePanel component * Use Kolide logo * Renames AdminSidePanel to SidePanel * Avatar component to render user's gravatar image * Adds CoreLayout with rendered SidePanel
34 lines
688 B
JavaScript
34 lines
688 B
JavaScript
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);
|
|
|