@orsetra/shared-ui 1.5.3 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -239,10 +239,14 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {}, main_base_u
|
|
|
239
239
|
"flex-1 overflow-y-auto",
|
|
240
240
|
isCollapsed ? "px-1 py-3 space-y-0.5" : "px-3 py-4 space-y-1"
|
|
241
241
|
)}>
|
|
242
|
-
{/* Main menu items — only shown in collapsed mode */}
|
|
243
|
-
{isCollapsed && mainMenuItems.length > 0 && (
|
|
242
|
+
{/* Main menu items — only shown in collapsed mode, excluding items already in currentNavigation */}
|
|
243
|
+
{isCollapsed && mainMenuItems.length > 0 && (() => {
|
|
244
|
+
const navIds = new Set(currentNavigation.map((n) => n.id))
|
|
245
|
+
const filteredMain = mainMenuItems.filter((item) => !navIds.has(item.id))
|
|
246
|
+
if (filteredMain.length === 0) return null
|
|
247
|
+
return (
|
|
244
248
|
<>
|
|
245
|
-
{
|
|
249
|
+
{filteredMain.map((item) => {
|
|
246
250
|
const href = `${main_base_url}/${item.id}`
|
|
247
251
|
const isActive = currentMenu === item.id
|
|
248
252
|
const linkEl = (
|
|
@@ -268,7 +272,8 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {}, main_base_u
|
|
|
268
272
|
})}
|
|
269
273
|
<div className="border-t border-ui-border mx-1 my-1" />
|
|
270
274
|
</>
|
|
271
|
-
|
|
275
|
+
)
|
|
276
|
+
})()}
|
|
272
277
|
|
|
273
278
|
{currentNavigation.map((item) => {
|
|
274
279
|
const activeItemId = getCurrentMenuItem ? getCurrentMenuItem(pathname, searchParams) : null
|
|
@@ -297,7 +302,10 @@ function Sidebar({ currentMenu, onMainMenuToggle, sidebarMenus = {}, main_base_u
|
|
|
297
302
|
: "text-text-secondary hover:bg-ui-background hover:text-text-primary border-transparent"
|
|
298
303
|
)}
|
|
299
304
|
>
|
|
300
|
-
<item.icon
|
|
305
|
+
<item.icon
|
|
306
|
+
className="h-4 w-4 flex-shrink-0"
|
|
307
|
+
style={{ color: isActive ? '#0f62fe' : '#4589ff' }}
|
|
308
|
+
/>
|
|
301
309
|
{!isCollapsed && item.name}
|
|
302
310
|
</Link>
|
|
303
311
|
)
|