From 1e2b2df43727ac574fa0cecd9ce49a61dd6ebe8b Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Mon, 21 Apr 2025 01:59:33 +0000
Subject: fix(web): Fix sidebar lists getting opened on edit

---
 apps/web/components/shared/sidebar/SidebarItem.tsx | 36 ++++++++++------------
 1 file changed, 17 insertions(+), 19 deletions(-)

(limited to 'apps/web/components/shared/sidebar/SidebarItem.tsx')

diff --git a/apps/web/components/shared/sidebar/SidebarItem.tsx b/apps/web/components/shared/sidebar/SidebarItem.tsx
index c862cc83..cfbd7253 100644
--- a/apps/web/components/shared/sidebar/SidebarItem.tsx
+++ b/apps/web/components/shared/sidebar/SidebarItem.tsx
@@ -28,30 +28,28 @@ export default function SidebarItem({
   return (
     <li
       className={cn(
-        "relative rounded-lg hover:bg-accent",
+        "relative flex justify-between rounded-lg hover:bg-accent",
         path == currentPath ? "bg-accent/50" : "",
         className,
       )}
       style={style}
     >
-      {collapseButton}
-      <Link
-        href={path}
-        className={cn(
-          "flex w-full items-center rounded-[inherit] px-3 py-2",
-          linkClassName,
-        )}
-      >
-        <div className="flex w-full justify-between">
-          <div className="flex items-center gap-x-2">
-            {logo}
-            <span title={name} className="line-clamp-1">
-              {name}
-            </span>
-          </div>
-          {right}
-        </div>
-      </Link>
+      <div className="flex-1">
+        {collapseButton}
+        <Link
+          href={path}
+          className={cn(
+            "flex items-center gap-x-2 rounded-[inherit] px-3 py-2",
+            linkClassName,
+          )}
+        >
+          {logo}
+          <span title={name} className="line-clamp-1 break-all">
+            {name}
+          </span>
+        </Link>
+      </div>
+      {right}
     </li>
   );
 }
-- 
cgit v1.2.3-70-g09d2

