File tree Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import styles from './styles';
11
11
12
12
import AppBar from '../AppBar' ;
13
13
import Footer from '../Footer' ;
14
+ import LayoutActions from './LayoutActions' ;
14
15
15
16
// FIXME remove once material-ui drawer style is fixed
16
17
const isDocked = type => type === 'permanent' || type === 'persistent' ;
@@ -222,7 +223,16 @@ class Layout extends React.PureComponent {
222
223
{ rightDrawerContentWithProps }
223
224
</ Drawer >
224
225
) : 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 >
226
236
{ footerContent ? (
227
237
< Footer { ...footerProps } > { footerContent } </ Footer >
228
238
) : null }
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+
3
+ const LayoutActions = React . createContext ( {
4
+ toggleLeftDrawer : ( ) => { } ,
5
+ toggleRightDrawer : ( ) => { } ,
6
+ handleRightDrawerClose : ( ) => { } ,
7
+ handleLeftDrawerClose : ( ) => { } ,
8
+ } ) ;
9
+
10
+ export default LayoutActions ;
Original file line number Diff line number Diff line change 1
1
import Layout from './Layout' ;
2
+ import LayoutActions from './LayoutActions' ;
2
3
4
+ export { LayoutActions } ;
3
5
export default Layout ;
Original file line number Diff line number Diff line change 1
- import Layout from './components/Layout' ;
1
+ import Layout , { LayoutActions } from './components/Layout' ;
2
2
3
+ export { LayoutActions } ;
3
4
export { default as AppBar } from './components/AppBar' ;
4
5
export { default as Footer } from './components/Footer' ;
5
6
6
-
7
7
export { default as BasicAppBar } from './templates/AppBar/BasicAppBar' ;
8
8
export { default as TwoRowsAppBar } from './templates/AppBar/TwoRowsAppBar' ;
9
9
export { default as BasicFooter } from './templates/Footer/BasicFooter' ;
You can’t perform that action at this time.
0 commit comments