mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #65
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user