From 8c18af44bdd8ef7c79923818c99a40a8dcba3d47 Mon Sep 17 00:00:00 2001 From: Petter Hohle Date: Tue, 3 Dec 2024 10:53:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Hide=20filter=20for=20locations?= =?UTF-8?q?=20missing=20job=20postings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/jobs/JobPostingList.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/sections/jobs/JobPostingList.tsx b/src/components/sections/jobs/JobPostingList.tsx index 70e0af7ac..0369b300e 100644 --- a/src/components/sections/jobs/JobPostingList.tsx +++ b/src/components/sections/jobs/JobPostingList.tsx @@ -81,16 +81,17 @@ export default function JobPostingList({ background="violet" /> {sortAlphabetically(companyLocations).map( - (location: CompanyLocation) => ( - setLocationFilter(location)} - text={`${location.companyLocationName} (${jobPostingsPerLocation[location.companyLocationName]})`} - key={location._id} - background="violet" - /> - ), + (location: CompanyLocation) => + jobPostingsPerLocation[location.companyLocationName] > 0 && ( + setLocationFilter(location)} + text={`${location.companyLocationName} (${jobPostingsPerLocation[location.companyLocationName]})`} + key={location._id} + background="violet" + /> + ), )}