fleet/frontend/layouts/CoreLayout/CoreLayout.jsx
Mike Stone bba69412b9 Side panel (#216)
* 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
2016-09-20 20:07:32 -07:00

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);