1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/packages/unleash-frontend-next/src/App.jsx

36 lines
1.1 KiB
React
Raw Normal View History

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