diff --git a/frontend/src/Components/Navbar/Navbar.tsx b/frontend/src/Components/Navbar/Navbar.tsx index 46e823da5..f30460a8d 100644 --- a/frontend/src/Components/Navbar/Navbar.tsx +++ b/frontend/src/Components/Navbar/Navbar.tsx @@ -13,7 +13,9 @@ import type { RecruitmentDto } from '~/dto'; import { useDesktop, useScrollY } from '~/hooks'; import { STATUS } from '~/http_status_codes'; import { KEY } from '~/i18n/constants'; +import { reverse } from '~/named-urls'; import { ROUTES } from '~/routes'; +import { dbT } from '~/utils'; import styles from './Navbar.module.scss'; import { HamburgerMenu, LanguageButton, NavbarItem } from './components'; @@ -106,6 +108,23 @@ export function Navbar() { ); + const recruitmentLinks = ( + <> + {activeRecruitments?.map((recruitment) => ( + setExpandedDropdown('')} + > + {dbT(recruitment, 'name')} {recruitment.organization.toString()} + + ))} + + ); const navbarHeaders = (
@@ -134,6 +153,8 @@ export function Navbar() { route={ROUTES.frontend.recruitment} label={t(KEY.common_volunteer)} labelClassName={activeRecruitments && styles.active_recruitment} + dropdownLinks={recruitmentLinks} + showDropDownIcon={false} />
); diff --git a/frontend/src/Components/Navbar/components/NavbarItem/NavbarItem.tsx b/frontend/src/Components/Navbar/components/NavbarItem/NavbarItem.tsx index 371f7f36f..21ab66504 100644 --- a/frontend/src/Components/Navbar/components/NavbarItem/NavbarItem.tsx +++ b/frontend/src/Components/Navbar/components/NavbarItem/NavbarItem.tsx @@ -13,6 +13,7 @@ type NavbarItemProps = { labelClassName?: string; dropdownLinks?: Children; expandedDropdown?: string; + showDropDownIcon?: boolean; setExpandedDropdown: SetState; }; @@ -26,6 +27,7 @@ export function NavbarItem({ setExpandedDropdown, dropdownLinks, labelClassName, + showDropDownIcon = true, }: NavbarItemProps) { const { setIsMobileNavigation } = useGlobalContext(); const isDesktop = useDesktop(); @@ -67,7 +69,7 @@ export function NavbarItem({ {icon && } {label} - {dropdownLinks && ( + {dropdownLinks && showDropDownIcon && (