Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix nav item title and badge visibility in collapsed icon mode (#14311)

Damian Legawiec4dc93127e845
diff --git a/packages/dashboard-core/src/components/nav-main.tsx b/packages/dashboard-core/src/components/nav-main.tsx
index 873b78c98e..3bea6e937e 100644
--- a/packages/dashboard-core/src/components/nav-main.tsx
+++ b/packages/dashboard-core/src/components/nav-main.tsx
@@ -102,9 +102,12 @@ function NavItemContent({
>
<Link to={item.url}>
<NavIcon icon={item.icon} isActive={itemIsActive} />
- <span>{item.title}</span>
+ {/* Explicitly hide in collapsed icon mode: a trailing badge span would
+ otherwise steal the `span:last-child` position the base button style
+ relies on to hide the label, leaving the title visible. */}
+ <span className="group-data-[collapsible=icon]:hidden">{item.title}</span>
{item.badge && (
- <span className="ml-auto">
+ <span className="ml-auto group-data-[collapsible=icon]:hidden">
<item.badge />
</span>
)}