diff --git a/client/src/components/design-elements/BasePage.tsx b/client/src/components/design-elements/BasePage.tsx index f523ab79f..6c9ffe1df 100644 --- a/client/src/components/design-elements/BasePage.tsx +++ b/client/src/components/design-elements/BasePage.tsx @@ -10,14 +10,11 @@ interface BasePageProps extends StackProps { breadcrumbOverride?: string[]; } -export const BasePage: React.FC = ({ +export const BasePage = ({ children, breadcrumbOverride, ...props -}: { - children: React.ReactNode; - breadcrumbOverride?: string[]; -}) => { +}: BasePageProps) => { const theme = useTheme(); return ( @@ -38,7 +35,7 @@ interface BasePageWithStatesProps extends StackProps { children: React.ReactNode; } -export const BasePageWithStates: React.FC = ({ +export const BasePageWithStates = ({ loading, error, items, @@ -94,9 +91,7 @@ const isEmpty = (items: any[]) => { return false; }; -export const MonitorBasePageWithStates: React.FC< - MonitorBasePageWithStatesProps -> = ({ +export const MonitorBasePageWithStates = ({ loading, error, items, diff --git a/client/src/components/layouts/sidebar/index.tsx b/client/src/components/layouts/sidebar/index.tsx index a243ef9b2..15346f6d5 100644 --- a/client/src/components/layouts/sidebar/index.tsx +++ b/client/src/components/layouts/sidebar/index.tsx @@ -53,8 +53,6 @@ export const SideBar = () => { backgroundColor: theme.palette.background.paper, }} > - {/* Sidebar collapse handled by Logo click */} - { item={item} sidebarOpen={sideBarOpen} selected={selected} - onClick={() => navigate(`/${item.path}`)} + onClick={() => { + navigate(`/${item.path}`); + if (isSmall) { + dispatch(setSidebarOpen(false)); + } + }} /> ); })} @@ -99,6 +102,9 @@ export const SideBar = () => { } else { navigate(`/${item.path}`); } + if (isSmall) { + dispatch(setSidebarOpen(false)); + } }} /> );