|
| 1 | +import { MOBILE_BREAKPOINT } from "../../constants/BreakPoints"; |
| 2 | +import { Color } from "../../styles/colors"; |
| 3 | +import { jobOffers } from "./JobsData"; |
| 4 | + |
| 5 | +import React, { FC } from "react"; |
| 6 | +import LessThanBlueIcon from "../../assets/images/LessThanBlueIcon.svg"; |
| 7 | +import MoreThanBlueIcon from "../../assets/images/MoreThanBlueIcon.svg"; |
| 8 | +import SectionWrapper from "../../components/SectionWrapper/SectionWrapper"; |
| 9 | +import TitleSection from "../../components/SectionTitle/TitleSection"; |
| 10 | +import { useWindowSize } from "react-use"; |
| 11 | +import data from "../../data/2024.json"; |
| 12 | +import { |
| 13 | + Companies, |
| 14 | + CompanyNameLink, |
| 15 | + StyledLessIcon, |
| 16 | + StyledMoreIcon, |
| 17 | + StyledTitleContainer, |
| 18 | +} from "../../styles/JobOffers/JobOffers.Style"; |
| 19 | +import CompanyOffers from "../../components/JobOffers/CompanyOffers"; |
| 20 | + |
| 21 | +const NoOffersAvailable = () => ( |
| 22 | + <h4 style={{ color: Color.DARK_BLUE }}>No job offers available yet</h4> |
| 23 | +); |
| 24 | + |
| 25 | +const MoreThanLessThan = () => ( |
| 26 | + <> |
| 27 | + <StyledLessIcon src={LessThanBlueIcon} /> |
| 28 | + <StyledMoreIcon src={MoreThanBlueIcon} /> |
| 29 | + </> |
| 30 | +); |
| 31 | + |
| 32 | +const JobOffers2024: FC<React.PropsWithChildren<unknown>> = () => { |
| 33 | + const { width } = useWindowSize(); |
| 34 | + |
| 35 | + React.useEffect(() => { |
| 36 | + document.title = `Job Offers - ${data.title} - ${data.edition}`; |
| 37 | + }, []); |
| 38 | + |
| 39 | + return ( |
| 40 | + <SectionWrapper color={Color.WHITE} marginTop={6} paddingBottom={100}> |
| 41 | + <section> |
| 42 | + <StyledTitleContainer> |
| 43 | + <TitleSection |
| 44 | + title="JOB OFFERS" |
| 45 | + subtitle="Have a look at some opportunities" |
| 46 | + color={Color.BLACK_BLUE} |
| 47 | + /> |
| 48 | + </StyledTitleContainer> |
| 49 | + {width > MOBILE_BREAKPOINT && <MoreThanLessThan/>} |
| 50 | + {!data.jobOffers.enabled && <NoOffersAvailable />} |
| 51 | + {data.jobOffers.enabled && ( |
| 52 | + <div id="job-offers"> |
| 53 | + <Companies id="companies"> |
| 54 | + {jobOffers.map((company) => ( |
| 55 | + <CompanyNameLink |
| 56 | + href={` #${company.name.replaceAll(" ", "-").toLowerCase()}`} |
| 57 | + key={company.id} |
| 58 | + > |
| 59 | + {company.name} |
| 60 | + </CompanyNameLink> |
| 61 | + ))} |
| 62 | + </Companies> |
| 63 | + <div id="offers"> |
| 64 | + {jobOffers.map((company) => ( |
| 65 | + <CompanyOffers company={company} key={company.id} /> |
| 66 | + ))} |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + )} |
| 70 | + </section> |
| 71 | + </SectionWrapper> |
| 72 | + ); |
| 73 | +}; |
| 74 | + |
| 75 | +export default JobOffers2024; |
0 commit comments