2021-05-18 04:25:07 +08:00
|
|
|
import React from 'react';
|
|
|
|
import SidebarContent from './component';
|
2021-08-05 19:03:24 +08:00
|
|
|
import { LayoutContextFunc } from '../layout/context';
|
2021-05-18 04:25:07 +08:00
|
|
|
|
|
|
|
const SidebarContentContainer = (props) => {
|
2021-08-05 19:03:24 +08:00
|
|
|
const { layoutContextState, layoutContextDispatch } = props;
|
2021-05-18 04:25:07 +08:00
|
|
|
const {
|
2021-05-19 22:51:31 +08:00
|
|
|
output, input,
|
2021-08-05 19:03:24 +08:00
|
|
|
} = layoutContextState;
|
2021-05-19 22:51:31 +08:00
|
|
|
const { sidebarContent: sidebarContentInput } = input;
|
|
|
|
const { sidebarContentPanel } = sidebarContentInput;
|
2021-05-18 04:25:07 +08:00
|
|
|
const { sidebarContent } = output;
|
|
|
|
|
|
|
|
if (sidebarContent.display === false) return null;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<SidebarContent
|
|
|
|
{...sidebarContent}
|
2021-08-05 19:03:24 +08:00
|
|
|
contextDispatch={layoutContextDispatch}
|
2021-05-18 04:25:07 +08:00
|
|
|
sidebarContentPanel={sidebarContentPanel}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-08-05 19:03:24 +08:00
|
|
|
export default LayoutContextFunc.withConsumer(SidebarContentContainer);
|