add use-context-selector to sidebar-navigation

This commit is contained in:
Ramon Souza 2021-09-09 10:55:07 -03:00
parent f3bd32b5df
commit 24dee066cd

View File

@ -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;