2016-11-10 14:26:24 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { Layout, Panel, NavDrawer, AppBar } from 'react-toolbox';
|
|
|
|
import style from './styles.scss';
|
|
|
|
import ErrorContainer from './error/error-container';
|
|
|
|
|
2016-11-24 21:32:29 +01:00
|
|
|
import UserContainer from './user/user-container';
|
|
|
|
|
2016-11-10 14:26:24 +01:00
|
|
|
import Navigation from './nav';
|
|
|
|
|
|
|
|
export default class App extends Component {
|
|
|
|
constructor (props) {
|
|
|
|
super(props);
|
|
|
|
this.state = { drawerActive: false };
|
|
|
|
|
|
|
|
this.toggleDrawerActive = () => {
|
|
|
|
this.setState({ drawerActive: !this.state.drawerActive });
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
onOverlayClick = () => this.setState({ drawerActive: false });
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<div className={style.container}>
|
|
|
|
<AppBar title="Unleash Admin" leftIcon="menu" onLeftIconClick={this.toggleDrawerActive} className={style.appBar} />
|
|
|
|
<div className={style.container} style={{ top: '6.4rem' }}>
|
|
|
|
<Layout>
|
|
|
|
<NavDrawer active={this.state.drawerActive} permanentAt="sm" onOverlayClick={this.onOverlayClick} >
|
|
|
|
<Navigation />
|
|
|
|
</NavDrawer>
|
|
|
|
<Panel scrollY>
|
|
|
|
<div style={{ padding: '1.8rem' }}>
|
2016-11-24 21:32:29 +01:00
|
|
|
<UserContainer />
|
2016-11-10 14:26:24 +01:00
|
|
|
{this.props.children}
|
|
|
|
</div>
|
|
|
|
</Panel>
|
|
|
|
<ErrorContainer />
|
|
|
|
</Layout>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|