From ab4a5fb7f5622952b3ceed479a7998accd414824 Mon Sep 17 00:00:00 2001 From: magsyg Date: Wed, 11 Dec 2024 18:54:41 +0100 Subject: [PATCH] fix header showing active recruitment when none --- frontend/src/Components/Navbar/Navbar.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/Components/Navbar/Navbar.tsx b/frontend/src/Components/Navbar/Navbar.tsx index 46e823da5..4f2ab2c73 100644 --- a/frontend/src/Components/Navbar/Navbar.tsx +++ b/frontend/src/Components/Navbar/Navbar.tsx @@ -56,6 +56,8 @@ export function Navbar() { }); }, []); + const showActiveRecruitments = activeRecruitments !== undefined && activeRecruitments?.length > 0; + // Return profile button for navbar if logged in. const mobileProfileButton = (
@@ -133,7 +135,7 @@ export function Navbar() { expandedDropdown={expandedDropdown} route={ROUTES.frontend.recruitment} label={t(KEY.common_volunteer)} - labelClassName={activeRecruitments && styles.active_recruitment} + labelClassName={showActiveRecruitments ? styles.active_recruitment : ''} />
);