@@ -8,7 +8,7 @@ import Typography from 'material-ui/Typography';
8
8
import MenuIcon from 'material-ui-icons/Menu' ;
9
9
import Hidden from 'material-ui/Hidden' ;
10
10
import { withStyles } from 'material-ui/styles' ;
11
- import withWidth from 'material-ui/utils/withWidth' ;
11
+ import withWidth , { isWidthDown } from 'material-ui/utils/withWidth' ;
12
12
import compose from 'recompose/compose' ;
13
13
14
14
import styles from './styles' ;
@@ -20,11 +20,17 @@ class BasicAppBar extends React.PureComponent {
20
20
title : PropTypes . string ,
21
21
logo : PropTypes . string ,
22
22
onIconClick : PropTypes . func ,
23
+ menuIconAlways : PropTypes . bool ,
24
+ width : PropTypes . string ,
25
+ } ;
26
+
27
+ static defaultProps = {
28
+ menuIconAlways : false ,
23
29
} ;
24
30
25
31
handleIconClick = ( ) => {
26
32
this . props . onIconClick ( ) ;
27
- }
33
+ } ;
28
34
29
35
renderLogo = ( ) => {
30
36
const { classes, title, logo } = this . props ;
@@ -43,14 +49,18 @@ class BasicAppBar extends React.PureComponent {
43
49
} ;
44
50
45
51
render ( ) {
46
- const { links } = this . props ;
52
+ const { links, menuIconAlways , width } = this . props ;
47
53
return (
48
54
< Toolbar >
49
- < Hidden smUp >
50
- < IconButton color = "inherit" aria-label = "Menu" onClick = { this . handleIconClick } >
55
+ { menuIconAlways || isWidthDown ( 'xs' , width ) ? (
56
+ < IconButton
57
+ color = "inherit"
58
+ aria-label = "Menu"
59
+ onClick = { this . handleIconClick }
60
+ >
51
61
< MenuIcon />
52
62
</ IconButton >
53
- </ Hidden >
63
+ ) : null }
54
64
{ this . renderLogo ( ) }
55
65
< Hidden xsDown >
56
66
< div >
0 commit comments