Skip to content

Commit faac696

Browse files
committed
setup the LayoutActions Provider
1 parent 8a38e4c commit faac696

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/Layout/Layout.jsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import styles from './styles';
1111

1212
import AppBar from '../AppBar';
1313
import Footer from '../Footer';
14+
import LayoutActions from './LayoutActions';
1415

1516
// FIXME remove once material-ui drawer style is fixed
1617
const isDocked = type => type === 'permanent' || type === 'persistent';
@@ -222,7 +223,16 @@ class Layout extends React.PureComponent {
222223
{rightDrawerContentWithProps}
223224
</Drawer>
224225
) : null}
225-
<main className={mainClassnames}>{children}</main>
226+
<LayoutActions.Provider
227+
value={{
228+
toggleLeftDrawer: this.toggleLeftDrawer,
229+
toggleRightDrawer: this.toggleRightDrawer,
230+
handleLeftDrawerClose: this.handleLeftDrawerClose,
231+
handleRightDrawerClose: this.handleRightDrawerClose,
232+
}}
233+
>
234+
<main className={mainClassnames}>{children}</main>
235+
</LayoutActions.Provider>
226236
{footerContent ? (
227237
<Footer {...footerProps}>{footerContent}</Footer>
228238
) : null}

0 commit comments

Comments
 (0)