index.js (1673B)
1 import React from 'react'; 2 import ReactDOM from 'react-dom'; 3 import { AppBar, Checkbox, IconButton } from 'react-toolbox'; 4 import { Layout, NavDrawer, Panel, Sidebar } from 'react-toolbox'; 5 import { ThemeProvider } from 'react-css-themr'; 6 import theme from './theme'; 7 import Home from './pages/Home'; 8 import Notification from 'react-web-notification'; 9 10 //allow react dev tools work 11 window.React = React; 12 13 class Index extends React.Component { 14 constructor() { 15 super(); 16 this.state = { 17 drawerActive: false 18 }; 19 } 20 21 toggleDrawerActive = () => { 22 this.setState({ drawerActive: !this.state.drawerActive }); 23 }; 24 25 render() { 26 return ( 27 <div> 28 <ThemeProvider theme={theme}> 29 <Layout className="main_content"> 30 <NavDrawer active={this.state.drawerActive} 31 onOverlayClick={ this.toggleDrawerActive }> 32 <p> 33 Navigation, account switcher, etc. go here. 34 </p> 35 </NavDrawer> 36 <Panel> 37 <AppBar leftIcon='menu' onLeftIconClick={ this.toggleDrawerActive } /> 38 <div> 39 <h1>Main Content</h1> 40 <Home/> 41 </div> 42 </Panel> 43 </Layout> 44 </ThemeProvider> 45 <Notification title="test" /> 46 </div> 47 ); 48 } 49 } 50 51 ReactDOM.render(<Index/>, document.getElementById('content'));