diff --git a/src/components/sections/jobs/JobPostingList.tsx b/src/components/sections/jobs/JobPostingList.tsx index 810afed34..addaa8e6f 100644 --- a/src/components/sections/jobs/JobPostingList.tsx +++ b/src/components/sections/jobs/JobPostingList.tsx @@ -57,7 +57,8 @@ export default function JobPostingList({ active={!locationFilter} type="button" onClick={() => setLocationFilter(null)} - text={"Alle"} + text="Alle" + background="violet" /> {companyLocations.map((location: CompanyLocation) => ( setLocationFilter(location)} text={location.companyLocationName} key={location._id} + background="violet" /> ))} diff --git a/src/components/tag/index.tsx b/src/components/tag/index.tsx index 468d3ae93..f17917ff7 100644 --- a/src/components/tag/index.tsx +++ b/src/components/tag/index.tsx @@ -14,9 +14,22 @@ type TagInner = href: string; } & JSX.IntrinsicElements["link"]); +function getBackgroundClass(backgroundColor: string) { + switch (backgroundColor) { + case "light": + return ""; + case "dark": + return styles["tag--bgDark"]; + case "violet": + return styles["tag--bgViolet"]; + default: + return ""; + } +} + type TagProps = { active?: boolean; - background?: "light" | "dark"; + background?: "light" | "dark" | "violet"; text: string; } & TagInner; @@ -27,8 +40,8 @@ export const Tag = ({ ...props }: TagProps) => { const activeClass = active ? styles["tag--active"] : ""; - const bgDarkClass = background === "dark" ? styles["tag--bgDark"] : ""; - const className = `${styles.tag} ${activeClass} ${bgDarkClass}`; + const bgClass = getBackgroundClass(background); + const className = `${styles.tag} ${activeClass} ${bgClass}`; if (props.type === "button") { return (