add use-context-selector to sidebar-navigation
This commit is contained in:
parent
f3bd32b5df
commit
24dee066cd
@ -2,20 +2,20 @@ import React from 'react';
|
||||
import { LayoutContextFunc } from '../layout/context';
|
||||
import SidebarNavigation from './component';
|
||||
|
||||
const SidebarNavigationContainer = (props) => {
|
||||
const { layoutContextState, layoutContextDispatch, openPanel } = props;
|
||||
const { output } = layoutContextState;
|
||||
const { sidebarNavigation } = output;
|
||||
const SidebarNavigationContainer = () => {
|
||||
const { layoutContextSelector } = LayoutContextFunc;
|
||||
|
||||
const sidebarNavigation = layoutContextSelector.selectOutput((i) => i.sidebarNavigation);
|
||||
const layoutDispatch = layoutContextSelector.layoutDispatch();
|
||||
|
||||
if (sidebarNavigation.display === false) return null;
|
||||
|
||||
return (
|
||||
<SidebarNavigation
|
||||
{...sidebarNavigation}
|
||||
openPanel={openPanel}
|
||||
contextDispatch={layoutContextDispatch}
|
||||
contextDispatch={layoutDispatch}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default LayoutContextFunc.withConsumer(SidebarNavigationContainer);
|
||||
export default SidebarNavigationContainer;
|
||||
|
Loading…
Reference in New Issue
Block a user