This commit is contained in:
Tomas Dvorak
2025-10-19 17:16:57 +02:00
parent e9a63073e5
commit 77213f4e83
76 changed files with 9728 additions and 935 deletions
+20 -1
View File
@@ -516,7 +516,26 @@ const Navbar = () => {
let NAV_LINKS: NavLink[] = useMemo(() => {
if (!navLoading && dynamicNavItems.length > 0) {
// Use dynamic navigation from API
return dynamicNavItems.map(convertToNavLink);
const navLinks = dynamicNavItems.map(convertToNavLink);
// Inject categories into "Články" or "Blog" navigation item if it exists
if (categoryItems.length > 0) {
const articlesIndex = navLinks.findIndex(link =>
link.label === 'Články' ||
link.label === 'Blog' ||
link.to === '/blog'
);
if (articlesIndex !== -1) {
// Add or merge categories into the articles navigation item
navLinks[articlesIndex] = {
...navLinks[articlesIndex],
items: categoryItems
};
}
}
return navLinks;
}
// Fallback to hardcoded navigation