mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-12 00:15:48 +01:00
⏪ Revert dynamic gridstack column count depending on sidebars
This commit is contained in:
@@ -16,7 +16,15 @@ export const DashboardSidebar = ({ location, isGridstackReady }: DashboardSideba
|
|||||||
} = useCardStyles(false);
|
} = useCardStyles(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card p={0} m={0} radius="lg" className={cardClass} w={300}>
|
<Card
|
||||||
|
p={0}
|
||||||
|
m={0}
|
||||||
|
radius="lg"
|
||||||
|
className={cardClass}
|
||||||
|
style={{ borderStyle: 'dashed' }}
|
||||||
|
w={300}
|
||||||
|
withBorder
|
||||||
|
>
|
||||||
{isGridstackReady && <SidebarInner location={location} />}
|
{isGridstackReady && <SidebarInner location={location} />}
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -28,16 +28,11 @@ export const useNamedWrapperColumnCount = (): 'small' | 'medium' | 'large' | nul
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useWrapperColumnCount = () => {
|
export const useWrapperColumnCount = () => {
|
||||||
const { config } = useConfigContext();
|
|
||||||
const numberOfSidebars =
|
|
||||||
(config?.settings.customization.layout.enabledLeftSidebar ? 1 : 0) +
|
|
||||||
(config?.settings.customization.layout.enabledRightSidebar ? 1 : 0);
|
|
||||||
|
|
||||||
switch (useNamedWrapperColumnCount()) {
|
switch (useNamedWrapperColumnCount()) {
|
||||||
case 'large':
|
case 'large':
|
||||||
return 15 - numberOfSidebars * 2;
|
return 12;
|
||||||
case 'medium':
|
case 'medium':
|
||||||
return 9 - numberOfSidebars * 2;
|
return 6;
|
||||||
case 'small':
|
case 'small':
|
||||||
return 3;
|
return 3;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user