fix(navbar): simplify tools dropdown to clean text-only typography and update cta text to try tools for free
This commit is contained in:
@@ -109,7 +109,7 @@ export function Navbar({ config, currentLocale, categories = [], totalToolsCount
|
||||
return pathname.startsWith(href);
|
||||
};
|
||||
|
||||
const ctaLabel = resolveLocalised(config.nav?.cta?.label, currentLocale) || 'Try tools free';
|
||||
const ctaLabel = resolveLocalised(config.nav?.cta?.label, currentLocale) || 'Try tools for free';
|
||||
const ctaHref = config.nav?.cta?.href || '/tools';
|
||||
const viewAllText = config.nav?.toolsDropdown?.viewAllText
|
||||
? resolveLocalised(config.nav.toolsDropdown.viewAllText, currentLocale)
|
||||
@@ -162,16 +162,15 @@ export function Navbar({ config, currentLocale, categories = [], totalToolsCount
|
||||
}`} />
|
||||
</Link>
|
||||
|
||||
{/* Tools Dropdown Menu - Sleek, Dynamic JSON-Driven */}
|
||||
{/* Tools Dropdown Menu - Sleek, Clean & Professional (Text Only, No Icons) */}
|
||||
{toolsDropdownOpen && (
|
||||
<div
|
||||
className="absolute top-full left-1/2 -translate-x-1/2 pt-2.5 w-[320px] z-50 animate-in fade-in zoom-in-95 duration-150"
|
||||
className="absolute top-full left-1/2 -translate-x-1/2 pt-2.5 w-[280px] z-50 animate-in fade-in zoom-in-95 duration-150"
|
||||
>
|
||||
<div className="p-2 rounded-2xl bg-paper-hi border border-rule shadow-xl space-y-1">
|
||||
{/* Dynamic Categories List from JSON */}
|
||||
{/* Dynamic Categories List from JSON (Clean Typography, No Icons) */}
|
||||
<div className="space-y-0.5">
|
||||
{categories.map((cat) => {
|
||||
const Icon = (cat.icon && ICON_MAP[cat.icon]) || Sparkles;
|
||||
const catName = resolveLocalised(cat.name, currentLocale);
|
||||
const catDesc = resolveLocalised(cat.description, currentLocale);
|
||||
const catHref = `/tools#category-${cat.id}`;
|
||||
@@ -186,33 +185,27 @@ export function Navbar({ config, currentLocale, categories = [], totalToolsCount
|
||||
window.location.hash = `category-${cat.id}`;
|
||||
}
|
||||
}}
|
||||
className="group/item flex items-center gap-3 p-2.5 rounded-xl hover:bg-paper-2 transition-all duration-150"
|
||||
className="group/item block px-3.5 py-2.5 rounded-xl hover:bg-paper-2 transition-all duration-150"
|
||||
>
|
||||
<div className="w-8 h-8 rounded-lg bg-paper-2 border border-rule group-hover/item:border-accent/40 group-hover/item:bg-accent/10 flex items-center justify-center shrink-0 transition-colors">
|
||||
<Icon className="w-4 h-4 text-ink group-hover/item:text-accent transition-colors" />
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="font-display font-semibold text-xs text-ink group-hover/item:text-accent transition-colors">
|
||||
{catName}
|
||||
</span>
|
||||
<ChevronRight className="w-3.5 h-3.5 text-muted opacity-0 -translate-x-1 group-hover/item:opacity-100 group-hover/item:translate-x-0 transition-all" />
|
||||
</div>
|
||||
<p className="text-[11px] text-muted truncate font-body">
|
||||
<span className="font-sans font-semibold text-xs text-ink group-hover/item:text-accent transition-colors block">
|
||||
{catName}
|
||||
</span>
|
||||
{catDesc && (
|
||||
<p className="text-[11px] text-muted font-sans line-clamp-1 mt-0.5 group-hover/item:text-slate-600 transition-colors">
|
||||
{catDesc}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Clean Minimal Footer */}
|
||||
<div className="pt-1.5 mt-1 border-t border-rule/70 px-2.5 py-1">
|
||||
<div className="pt-2 mt-1 border-t border-rule/70 px-3.5 py-1">
|
||||
<Link
|
||||
href={link.href}
|
||||
onClick={() => setToolsDropdownOpen(false)}
|
||||
className="text-xs font-semibold text-accent hover:text-accent-hi inline-flex items-center justify-between w-full transition-colors py-1"
|
||||
className="text-xs font-sans font-semibold text-accent hover:text-accent-hi inline-flex items-center justify-between w-full transition-colors py-1"
|
||||
>
|
||||
<span>{viewAllText}</span>
|
||||
<ArrowRight className="w-3.5 h-3.5" />
|
||||
@@ -308,11 +301,10 @@ export function Navbar({ config, currentLocale, categories = [], totalToolsCount
|
||||
)}
|
||||
</Link>
|
||||
|
||||
{/* Sub-categories under Tools on mobile drawer */}
|
||||
{/* Sub-categories under Tools on mobile drawer (Clean Text Only, No Icons) */}
|
||||
{link.href === '/tools' && categories.length > 0 && (
|
||||
<div className="pl-3 pr-1 py-1 grid grid-cols-2 gap-1.5">
|
||||
{categories.map((cat) => {
|
||||
const Icon = (cat.icon && ICON_MAP[cat.icon]) || Sparkles;
|
||||
const catName = resolveLocalised(cat.name, currentLocale);
|
||||
const catHref = `/tools#category-${cat.id}`;
|
||||
|
||||
@@ -326,10 +318,9 @@ export function Navbar({ config, currentLocale, categories = [], totalToolsCount
|
||||
window.location.hash = `category-${cat.id}`;
|
||||
}
|
||||
}}
|
||||
className="flex items-center gap-2 p-2 rounded-xl text-xs text-ink hover:text-accent hover:bg-paper-2 bg-paper-hi/60 border border-rule font-body transition-colors"
|
||||
className="p-2.5 rounded-xl text-xs text-ink hover:text-accent hover:bg-paper-2 bg-paper-hi/60 border border-rule font-sans font-medium transition-colors text-center"
|
||||
>
|
||||
<Icon className="w-3.5 h-3.5 text-accent shrink-0" />
|
||||
<span className="truncate font-medium">{catName}</span>
|
||||
<span className="truncate">{catName}</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user