Commit ec5a5c49 authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

beter code

parent d61911af
...@@ -23,7 +23,7 @@ export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & { ...@@ -23,7 +23,7 @@ export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & {
}; };
const BasicLayout: React.FC<BasicLayoutProps> = props => { const BasicLayout: React.FC<BasicLayoutProps> = props => {
const { dispatch, children, route } = props; const { dispatch, children, route, settings } = props;
const { routes, authority } = route!; const { routes, authority } = route!;
/** /**
* constructor * constructor
...@@ -38,7 +38,6 @@ const BasicLayout: React.FC<BasicLayoutProps> = props => { ...@@ -38,7 +38,6 @@ const BasicLayout: React.FC<BasicLayoutProps> = props => {
*/ */
const handleMenuCollapse = (payload: boolean) => const handleMenuCollapse = (payload: boolean) =>
dispatch!({ type: 'global/changeLayoutCollapsed', payload }); dispatch!({ type: 'global/changeLayoutCollapsed', payload });
return ( return (
<> <>
<BasicLayoutComponents <BasicLayoutComponents
...@@ -46,15 +45,16 @@ const BasicLayout: React.FC<BasicLayoutProps> = props => { ...@@ -46,15 +45,16 @@ const BasicLayout: React.FC<BasicLayoutProps> = props => {
onCollapse={handleMenuCollapse} onCollapse={handleMenuCollapse}
rightContentRender={RightProps => <RightContent {...RightProps} />} rightContentRender={RightProps => <RightContent {...RightProps} />}
{...props} {...props}
{...settings}
> >
{children} {children}
</BasicLayoutComponents> </BasicLayoutComponents>
<SettingDrawer <SettingDrawer
settings={props.settings} settings={settings}
onSettingChange={settings => onSettingChange={config =>
dispatch!({ dispatch!({
type: 'settings/changeSetting', type: 'settings/changeSetting',
payload: settings, payload: config,
}) })
} }
/> />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment