fleet/frontend/layouts/CoreLayout/CoreLayout.jsx
Mike Stone 23ffa5be62 Query side panel (#269)
* QuerySidePanel component

* Adds all osquery table names to ace editor mode

* kolide theme for strings

* Detect OS from browser

* Show utility and specs availability as 'All Platforms'

* Show column description as alt text
2016-10-11 11:32:39 -04:00

60 lines
1.4 KiB
JavaScript

import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { StyleRoot } from 'radium';
import componentStyles from './styles';
import FlashMessage from '../../components/FlashMessage';
import SidePanel from '../../components/SidePanel';
export class CoreLayout extends Component {
static propTypes = {
children: PropTypes.node,
config: PropTypes.shape({
org_logo_url: PropTypes.string,
org_name: PropTypes.string,
}),
dispatch: PropTypes.func,
notifications: PropTypes.object,
showRightSidePanel: PropTypes.bool,
user: PropTypes.object,
};
render () {
const { children, config, dispatch, notifications, showRightSidePanel, user } = this.props;
const { wrapperStyles } = componentStyles;
if (!user) return false;
const { pathname } = global.window.location;
return (
<StyleRoot>
<SidePanel
config={config}
pathname={pathname}
user={user}
/>
<div style={wrapperStyles(showRightSidePanel)}>
<FlashMessage notification={notifications} dispatch={dispatch} />
{children}
</div>
</StyleRoot>
);
}
}
const mapStateToProps = (state) => {
const {
app: { config, showRightSidePanel },
auth: { user },
notifications,
} = state;
return {
config,
notifications,
showRightSidePanel,
user,
};
};
export default connect(mapStateToProps)(CoreLayout);