2016-09-11 21:54:31 +02:00
|
|
|
import React, { Component } from 'react';
|
2016-09-30 14:29:51 +02:00
|
|
|
import { Layout, Panel, NavDrawer, AppBar } from 'react-toolbox';
|
2016-09-13 23:01:38 +02:00
|
|
|
import style from './style';
|
2016-09-12 21:39:54 +02:00
|
|
|
|
|
|
|
import Navigation from './Navigation';
|
2016-09-11 21:54:31 +02:00
|
|
|
|
|
|
|
export default class App extends Component {
|
2016-09-13 23:43:54 +02:00
|
|
|
constructor (props) {
|
|
|
|
super(props);
|
|
|
|
this.state = { drawerActive: false };
|
2016-09-13 21:35:16 +02:00
|
|
|
|
2016-09-13 23:43:54 +02:00
|
|
|
this.toggleDrawerActive = () => {
|
|
|
|
this.setState({ drawerActive: !this.state.drawerActive });
|
|
|
|
};
|
|
|
|
}
|
2016-09-13 21:35:16 +02:00
|
|
|
|
2016-09-11 22:56:17 +02:00
|
|
|
render () {
|
|
|
|
return (
|
2016-09-13 22:28:23 +02:00
|
|
|
<div className={style.container}>
|
2016-09-30 14:29:51 +02:00
|
|
|
<AppBar title="Unleash Admin" leftIcon="menu" onLeftIconClick={this.toggleDrawerActive} />
|
2016-09-13 21:35:16 +02:00
|
|
|
<Layout>
|
2016-09-13 23:01:38 +02:00
|
|
|
<NavDrawer active={this.state.drawerActive} permanentAt="sm" style={{ width: '200px' }}>
|
2016-09-13 21:35:16 +02:00
|
|
|
<Navigation />
|
|
|
|
</NavDrawer>
|
|
|
|
<Panel scrollY={false}>
|
2016-09-13 23:43:54 +02:00
|
|
|
<div style={{ padding: '1.8em' }}>
|
2016-09-13 21:35:16 +02:00
|
|
|
{this.props.children}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Panel>
|
|
|
|
</Layout>
|
2016-09-12 21:39:54 +02:00
|
|
|
</div>
|
2016-09-11 22:56:17 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|