mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE): Use className props for drawer widths
This commit is contained in:
@@ -16,7 +16,6 @@ interface DrawerProps {
|
||||
onBackdropClick?: () => void;
|
||||
closeOnBackdropClick?: boolean;
|
||||
expandedContent?: ReactNode;
|
||||
expandedWidth?: string;
|
||||
}
|
||||
|
||||
type DrawerClassName = {
|
||||
@@ -25,6 +24,7 @@ type DrawerClassName = {
|
||||
drawerSide?: string;
|
||||
drawerOverlay?: string;
|
||||
drawerSidebarContent?: string;
|
||||
drawerExpandedContent?: string;
|
||||
};
|
||||
|
||||
const Drawer = ({
|
||||
@@ -39,7 +39,6 @@ const Drawer = ({
|
||||
onBackdropClick,
|
||||
closeOnBackdropClick = true,
|
||||
expandedContent,
|
||||
expandedWidth = 'w-[400px]',
|
||||
}: DrawerProps) => {
|
||||
const getDrawerClassNames = (): DrawerClassName => {
|
||||
const baseClassNames = {
|
||||
@@ -56,6 +55,9 @@ const Drawer = ({
|
||||
? 'w-full lg:min-w-[600px] lg:max-w-[600px]'
|
||||
: 'w-full max-w-[300px] lg:w-[300px]';
|
||||
}
|
||||
if (className?.drawerSidebarContent) {
|
||||
return '';
|
||||
}
|
||||
return 'w-full sm:min-w-120 sm:w-fit';
|
||||
};
|
||||
|
||||
@@ -174,7 +176,7 @@ const Drawer = ({
|
||||
<div
|
||||
className={cn(
|
||||
'border-l border-gray-200 bg-white flex flex-col h-full',
|
||||
expandedWidth
|
||||
className?.drawerExpandedContent
|
||||
)}
|
||||
>
|
||||
<div className='overflow-y-auto flex-1 h-full'>
|
||||
|
||||
@@ -58,7 +58,10 @@ export default function UniformityPageWrapper({
|
||||
zIndex='99999'
|
||||
sidebarContent={isOpen ? <div className=''>{children}</div> : null}
|
||||
expandedContent={expandedDrawerOpen ? expandedDrawerContent : null}
|
||||
expandedWidth='w-[500px]'
|
||||
className={{
|
||||
drawerSidebarContent: 'w-[446px]',
|
||||
drawerExpandedContent: 'w-[446px]',
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user