33// Use of this source code is governed by an MIT-style
44// license that can be found in the LICENSE file.
55
6- import React from 'react' ;
7- import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' ;
8- import AppBar from 'material-ui/AppBar' ;
9- import Drawer from 'material-ui/Drawer' ;
10- import { SMALL } from 'material-ui/utils/withWidth' ;
11- import { connect } from 'react-redux' ;
12- import { Router , Route , IndexRoute } from 'react-router' ;
13- import { push } from 'react-router-redux' ;
6+ import React from 'react'
7+ import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
8+ import AppBar from 'material-ui/AppBar'
9+ import Drawer from 'material-ui/Drawer'
10+ import { SMALL } from 'material-ui/utils/withWidth'
11+ import { connect } from 'react-redux'
12+ import { Router , Route , IndexRoute } from 'react-router'
13+ import { push } from 'react-router-redux'
1414
15- import { MirrorList , MenuList , CardMirror } from './redux/containers' ;
16- import { toggleDrawer , hideDrawer } from './redux/apps/guiApp' ;
17- import About from './components/About' ;
15+ import { MirrorList , MenuList , CardMirror } from './redux/containers'
16+ import { toggleDrawer , hideDrawer } from './redux/apps/guiApp'
17+ import About from './components/About'
1818
19- const Container = props => (
20- < div > { props . children } </ div >
21- ) ;
19+ const Container = props => < div > { props . children } </ div >
2220
2321Container . propTypes = {
2422 children : React . PropTypes . any ,
25- } ;
23+ }
2624
27- const Main = ( props ) => {
28- let DrawerOpen = false ;
29- let marginLeft = 0 ;
25+ const Main = props => {
26+ let DrawerOpen = false
27+ let marginLeft = 0
3028 if ( props . width === SMALL && props . DrawerOpen ) {
31- DrawerOpen = true ;
29+ DrawerOpen = true
3230 }
3331
3432 if ( props . width !== SMALL ) {
35- DrawerOpen = true ;
36- marginLeft = 300 ;
33+ DrawerOpen = true
34+ marginLeft = 300
3735 }
3836
39- return ( < MuiThemeProvider muiTheme = { props . Theme } >
40- < div >
41- < AppBar
42- title = { props . Title }
43- iconClassNameRight = "muidocs-icon-navigation-expand-more"
44- onLeftIconButtonTouchTap = { props . toggleDrawer }
45- showMenuIconButton = { props . width === SMALL }
46- />
47-
48- < Drawer open = { DrawerOpen } docked width = { 300 } >
37+ return (
38+ < MuiThemeProvider muiTheme = { props . Theme } >
39+ < div >
4940 < AppBar
5041 title = { props . Title }
42+ iconClassNameRight = "muidocs-icon-navigation-expand-more"
5143 onLeftIconButtonTouchTap = { props . toggleDrawer }
5244 showMenuIconButton = { props . width === SMALL }
5345 />
5446
55- < MenuList />
56- </ Drawer >
47+ < Drawer open = { DrawerOpen } docked width = { 300 } >
48+ < AppBar
49+ title = { props . Title }
50+ onLeftIconButtonTouchTap = { props . toggleDrawer }
51+ showMenuIconButton = { props . width === SMALL }
52+ />
53+
54+ < MenuList />
55+ </ Drawer >
5756
58- < div className = "foobar" style = { { marginLeft : `${ marginLeft } px` } } >
59- < Router history = { props . history } >
60- < Route path = "/" component = { Container } >
61- < IndexRoute component = { MirrorList } />
62- < Route path = "mirror/:id" component = { CardMirror } />
63- < Route path = "about" component = { About } />
64- </ Route >
65- </ Router >
57+ < div
58+ className = "foobar"
59+ style = { { marginLeft : `${ marginLeft } px` } }
60+ >
61+ < Router history = { props . history } >
62+ < Route path = "/" component = { Container } >
63+ < IndexRoute component = { MirrorList } />
64+ < Route path = "mirror/:id" component = { CardMirror } />
65+ < Route path = "about" component = { About } />
66+ </ Route >
67+ </ Router >
68+ </ div >
6669 </ div >
67- </ div >
68- </ MuiThemeProvider > ) ;
69- } ;
70+ </ MuiThemeProvider >
71+ )
72+ }
7073
7174Main . propTypes = {
7275 Theme : React . PropTypes . object ,
@@ -75,14 +78,17 @@ Main.propTypes = {
7578 toggleDrawer : React . PropTypes . func ,
7679 history : React . PropTypes . object ,
7780 width : React . PropTypes . number . isRequired ,
78- } ;
81+ }
7982
80- const mapStateToProps = state => ( { ...state . guiApp } ) ;
83+ const mapStateToProps = state => ( { ...state . guiApp } )
8184
8285const mapDispatchToProps = dispatch => ( {
8386 toggleDrawer : ( ) => {
84- dispatch ( toggleDrawer ( ) ) ;
87+ dispatch ( toggleDrawer ( ) )
8588 } ,
86- } ) ;
89+ } )
8790
88- export default connect ( mapStateToProps , mapDispatchToProps ) ( Main ) ;
91+ export default connect (
92+ mapStateToProps ,
93+ mapDispatchToProps
94+ ) ( Main )
0 commit comments