refactor(FE-316): Add expanded drawer content and dynamic width

This commit is contained in:
rstubryan
2025-12-26 22:50:41 +07:00
parent e0ee846106
commit 800739bd4f
5 changed files with 39 additions and 7 deletions
+12 -3
View File
@@ -50,12 +50,21 @@ const Drawer = ({
drawerSidebarContent: 'min-h-full bg-base-100',
};
const getSidebarWidth = () => {
if (variant === 'sidebar') {
return expandedContent
? 'w-full lg:min-w-[600px] lg:max-w-[600px]'
: 'w-full max-w-[300px] lg:w-[300px]';
}
return 'w-full sm:min-w-120 sm:w-fit';
};
if (variant === 'sidebar') {
return {
...baseClassNames,
drawerSidebarContent: cn(
baseClassNames.drawerSidebarContent,
'w-full max-w-[300px] lg:w-[300px]'
getSidebarWidth()
),
};
} else if (variant === 'right') {
@@ -68,7 +77,7 @@ const Drawer = ({
),
drawerSidebarContent: cn(
baseClassNames.drawerSidebarContent,
'w-full sm:min-w-120 sm:w-fit'
getSidebarWidth()
),
};
} else if (variant === 'left') {
@@ -80,7 +89,7 @@ const Drawer = ({
),
drawerSidebarContent: cn(
baseClassNames.drawerSidebarContent,
'w-full sm:min-w-120 sm:w-fit'
getSidebarWidth()
),
};
}