Fix sidebar styling

This commit is contained in:
ajnart
2023-01-13 14:12:09 +09:00
parent e8554890e0
commit 90ee7f2cc7

View File

@@ -1,4 +1,4 @@
import { Card } from '@mantine/core'; import { Card, Group, Stack } from '@mantine/core';
import { RefObject } from 'react'; import { RefObject } from 'react';
import { useCardStyles } from '../../../layout/useCardStyles'; import { useCardStyles } from '../../../layout/useCardStyles';
import { useGridstack } from '../gridstack/use-gridstack'; import { useGridstack } from '../gridstack/use-gridstack';
@@ -9,18 +9,24 @@ interface DashboardSidebarProps extends DashboardSidebarInnerProps {
isGridstackReady: boolean; isGridstackReady: boolean;
} }
export const DashboardSidebar = ({ location, isGridstackReady }: DashboardSidebarProps) => ( export const DashboardSidebar = ({ location, isGridstackReady }: DashboardSidebarProps) => {
const {
cx,
classes: { card: cardClass },
} = useCardStyles(false);
return (
<Card <Card
withBorder p={0}
m={0}
radius="lg"
className={cardClass}
w={300} w={300}
style={{
background: 'none',
borderStyle: 'dashed',
}}
> >
{isGridstackReady && <SidebarInner location={location} />} {isGridstackReady && <SidebarInner location={location} />}
</Card> </Card>
); );
};
interface DashboardSidebarInnerProps { interface DashboardSidebarInnerProps {
location: 'right' | 'left'; location: 'right' | 'left';
@@ -37,17 +43,18 @@ const SidebarInner = ({ location }: DashboardSidebarInnerProps) => {
} = useCardStyles(false); } = useCardStyles(false);
return ( return (
<Card withBorder mih="100%" p={0} radius="lg" className={cardClass} ref={refs.wrapper}>
<div <div
ref={refs.wrapper}
className="grid-stack grid-stack-sidebar" className="grid-stack grid-stack-sidebar"
style={{ transitionDuration: '0s', height: '100%' }} style={{
transitionDuration: '0s',
}}
data-sidebar={location} data-sidebar={location}
// eslint-disable-next-line react/no-unknown-property // eslint-disable-next-line react/no-unknown-property
gs-min-row={minRow} gs-min-row={minRow}
> >
<WrapperContent apps={apps} refs={refs} widgets={widgets} /> <WrapperContent apps={apps} refs={refs} widgets={widgets} />
</div> </div>
</Card>
); );
}; };