@@ -3,11 +3,11 @@ import Title from 'react-title-component';
33import AppBar from 'material-ui/AppBar' ;
44import IconButton from 'material-ui/IconButton' ;
55import spacing from 'material-ui/styles/spacing' ;
6- import styleResizable from 'material-ui/utils/styleResizable' ;
76import getMuiTheme from 'material-ui/styles/getMuiTheme' ;
87import { darkWhite , lightWhite , grey900 } from 'material-ui/styles/colors' ;
98import AppNavDrawer from './AppNavDrawer' ;
109import FullWidthSection from './FullWidthSection' ;
10+ import withWidth , { MEDIUM , LARGE } from 'material-ui/utils/withWidth' ;
1111
1212const githubButton = (
1313 < IconButton
@@ -22,6 +22,7 @@ const Master = createClass({
2222 propTypes : {
2323 children : PropTypes . node ,
2424 location : PropTypes . object ,
25+ width : PropTypes . number . isRequired ,
2526 } ,
2627
2728 contextTypes : {
@@ -32,10 +33,6 @@ const Master = createClass({
3233 muiTheme : PropTypes . object ,
3334 } ,
3435
35- mixins : [
36- styleResizable ,
37- ] ,
38-
3936 getInitialState ( ) {
4037 return {
4138 muiTheme : getMuiTheme ( ) ,
@@ -98,8 +95,7 @@ const Master = createClass({
9895 } ,
9996 } ;
10097
101- if ( this . isDeviceSize ( styleResizable . statics . Sizes . MEDIUM ) ||
102- this . isDeviceSize ( styleResizable . statics . Sizes . LARGE ) ) {
98+ if ( this . props . width === MEDIUM || this . props . width === LARGE ) {
10399 styles . content = Object . assign ( styles . content , styles . contentWhenMedium ) ;
104100 }
105101
@@ -156,7 +152,7 @@ const Master = createClass({
156152 let docked = false ;
157153 let showMenuIconButton = true ;
158154
159- if ( this . isDeviceSize ( styleResizable . statics . Sizes . LARGE ) && title !== '' ) {
155+ if ( this . props . width === LARGE && title !== '' ) {
160156 docked = true ;
161157 navDrawerOpen = true ;
162158 showMenuIconButton = false ;
@@ -223,4 +219,4 @@ const Master = createClass({
223219 } ,
224220} ) ;
225221
226- export default Master ;
222+ export default withWidth ( ) ( Master ) ;
0 commit comments