Skip to content

Commit

Permalink
fix: localtion label for job listings (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelbr authored Dec 12, 2024
1 parent 425bd85 commit ee8ffa4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/components/jobPosting/JobPosting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ function sortAlphabetically(list: string[]) {

interface JobPostingProps {
jobPosting: IJobPosting;
showLocations?: boolean;
}

export default function JobPosting({ jobPosting }: JobPostingProps) {
export default function JobPosting({
jobPosting,
showLocations = true,
}: JobPostingProps) {
const jobPostingLocations = sortAlphabetically(
jobPosting.locations.map(
(location: CompanyLocation) => location.companyLocationName,
Expand All @@ -30,9 +34,11 @@ export default function JobPosting({ jobPosting }: JobPostingProps) {
<div className={styles.role}>
<Text type={"h5"}>{jobPosting.role}</Text>
</div>
<div className={styles.locations}>
<Badge>{jobPostingLocations}</Badge>
</div>
{showLocations && (
<div className={styles.locations}>
<Badge>{jobPostingLocations}</Badge>
</div>
)}
</div>
</a>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/jobPosting/jobPosting.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
}

.role {
width: 250px;
@media (max-width: 640px) {
width: 100%;
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/sections/jobs/JobPostingList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ export default function JobPostingList({
</div>
<div className={styles.jobPostings}>
{filteredJobPostings?.map((jobPosting: IJobPosting) => (
<JobPosting jobPosting={jobPosting} key={jobPosting._key} />
<JobPosting
jobPosting={jobPosting}
key={jobPosting._key}
showLocations={locationFilter == null}
/>
))}
</div>
</div>
Expand Down

0 comments on commit ee8ffa4

Please sign in to comment.