Skip to content

Commit db285e2

Browse files
authored
Merge pull request #43 from OrigenStudio/feature/no-appbar-option
Now the AppBar is optional
2 parents 75ab318 + a0667a7 commit db285e2

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/components/Layout/Layout.jsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ class Layout extends React.PureComponent {
123123

124124
const mainClassnames = classNames(classes.main, {
125125
[`${classes.mainFixedAppBar}`]:
126-
appBarPosition === 'fixed' && !usingTwoRowAppBar,
126+
appBarContent && appBarPosition === 'fixed' && !usingTwoRowAppBar,
127127
[`${classes.mainFixedTwoRowAppBar}`]:
128-
appBarPosition === 'fixed' && usingTwoRowAppBar,
128+
appBarContent && appBarPosition === 'fixed' && usingTwoRowAppBar,
129129
[`${classes.mainGrow}`]: mainGrow && !usingTwoRowAppBar,
130130
[`${classes.mainGrowTwoRowAppBar}`]: mainGrow && usingTwoRowAppBar,
131131
[`${classes.mainStickyFooter}`]: stickyFooter,
@@ -180,15 +180,17 @@ class Layout extends React.PureComponent {
180180

181181
return (
182182
<div className={classes.layout}>
183-
<AppBar
184-
position={appBarPosition}
185-
toggleLeftDrawer={this.toggleLeftDrawer}
186-
toggleRightDrawer={this.toggleRightDrawer}
187-
className={appBarClassnames}
188-
{...appBarProps}
189-
>
190-
{appBarContent}
191-
</AppBar>
183+
{appBarContent ? (
184+
<AppBar
185+
position={appBarPosition}
186+
toggleLeftDrawer={this.toggleLeftDrawer}
187+
toggleRightDrawer={this.toggleRightDrawer}
188+
className={appBarClassnames}
189+
{...appBarProps}
190+
>
191+
{appBarContent}
192+
</AppBar>
193+
) : null}
192194
{leftDrawerContent ? (
193195
<Drawer
194196
open={leftDrawerOpen}

0 commit comments

Comments
 (0)