From e05278c618bad847a62d7bf93130043470c7d779 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sat, 14 Jan 2023 22:51:39 +0100 Subject: [PATCH] =?UTF-8?q?=E2=8F=AA=20Revert=20dynamic=20gridstack=20colu?= =?UTF-8?q?mn=20count=20depending=20on=20sidebars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dashboard/Wrappers/Sidebar/Sidebar.tsx | 10 +++++++++- src/components/Dashboard/Wrappers/gridstack/store.tsx | 9 ++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/Dashboard/Wrappers/Sidebar/Sidebar.tsx b/src/components/Dashboard/Wrappers/Sidebar/Sidebar.tsx index f97e7da02..cb8633428 100644 --- a/src/components/Dashboard/Wrappers/Sidebar/Sidebar.tsx +++ b/src/components/Dashboard/Wrappers/Sidebar/Sidebar.tsx @@ -16,7 +16,15 @@ export const DashboardSidebar = ({ location, isGridstackReady }: DashboardSideba } = useCardStyles(false); return ( - + {isGridstackReady && } ); diff --git a/src/components/Dashboard/Wrappers/gridstack/store.tsx b/src/components/Dashboard/Wrappers/gridstack/store.tsx index 81c32514f..59c0a7deb 100644 --- a/src/components/Dashboard/Wrappers/gridstack/store.tsx +++ b/src/components/Dashboard/Wrappers/gridstack/store.tsx @@ -28,16 +28,11 @@ export const useNamedWrapperColumnCount = (): 'small' | 'medium' | 'large' | nul }; export const useWrapperColumnCount = () => { - const { config } = useConfigContext(); - const numberOfSidebars = - (config?.settings.customization.layout.enabledLeftSidebar ? 1 : 0) + - (config?.settings.customization.layout.enabledRightSidebar ? 1 : 0); - switch (useNamedWrapperColumnCount()) { case 'large': - return 15 - numberOfSidebars * 2; + return 12; case 'medium': - return 9 - numberOfSidebars * 2; + return 6; case 'small': return 3; default: