From ce4e37c75b65ba79f9ac012de179f8e4f937be6a Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Mon, 16 Mar 2026 15:29:25 -0600 Subject: [PATCH] refactor: simplify sidebar state handling - Replaced direct state checks with a derived variable `isCollapsed` for better readability and maintainability. - Updated class names and conditions in the SidebarLogo component to use the new `isCollapsed` variable. - Adjusted overflow behavior in Sidebar and SidebarContent components for improved layout management. --- apps/dokploy/components/layouts/side.tsx | 30 ++++++++++-------------- apps/dokploy/components/ui/sidebar.tsx | 4 ++-- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/apps/dokploy/components/layouts/side.tsx b/apps/dokploy/components/layouts/side.tsx index d9f995c56..9f0bb482b 100644 --- a/apps/dokploy/components/layouts/side.tsx +++ b/apps/dokploy/components/layouts/side.tsx @@ -545,6 +545,7 @@ function SidebarLogo() { const { mutateAsync: setDefaultOrganization, isPending: isSettingDefault } = api.organization.setDefault.useMutation(); const { isMobile } = useSidebar(); + const isCollapsed = state === "collapsed" && !isMobile; const { data: activeOrganization } = api.organization.active.useQuery(); const { data: invitations, refetch: refetchInvitations } = @@ -570,7 +571,7 @@ function SidebarLogo() {
@@ -610,7 +611,7 @@ function SidebarLogo() {

@@ -619,7 +620,7 @@ function SidebarLogo() {

@@ -768,7 +769,7 @@ function SidebarLogo() { {/* Notification Bell */} - +
)} {dokployVersion && ( - <> -
- Version {dokployVersion} -
-
- {dokployVersion} -
- +
+ Version {dokployVersion} +
)}
diff --git a/apps/dokploy/components/ui/sidebar.tsx b/apps/dokploy/components/ui/sidebar.tsx index bb9d940a1..2160acfde 100644 --- a/apps/dokploy/components/ui/sidebar.tsx +++ b/apps/dokploy/components/ui/sidebar.tsx @@ -213,7 +213,7 @@ const Sidebar = React.forwardRef< } side={side} > -
{children}
+
{children}
); @@ -412,7 +412,7 @@ const SidebarContent = React.forwardRef< ref={ref} data-sidebar="content" className={cn( - "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", + "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-y-auto", className, )} {...props}