-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iframeFormation): add trouver une entreprise
- Loading branch information
Showing
5 changed files
with
239 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { fr } from "@codegouvfr/react-dsfr"; | ||
import { useState } from "react"; | ||
|
||
import community from "../../assets/images/community.svg"; | ||
import didYouKnow from "../../assets/images/didYouKnow.svg"; | ||
import house from "../../assets/images/house.svg"; | ||
import locationFrance from "../../assets/images/location-france.svg"; | ||
import school from "../../assets/images/school-small.svg"; | ||
import search from "../../assets/images/search.svg"; | ||
import selfTraining from "../../assets/images/self-training.svg"; | ||
import useBreakpoints from "../../hooks/useBreakpoints"; | ||
import { | ||
CardsContainer, | ||
DidYouKnowContainer, | ||
Position, | ||
TrouverEntrepriseCardContainer, | ||
TrouverUneEntrepriseRatingContainer, | ||
} from "./shared.style"; | ||
|
||
const getTrouverEntrepriseIcon = (label) => { | ||
switch (label) { | ||
case "En toute autonomie": | ||
return <img src={selfTraining} alt="" />; | ||
case "Avec l’aide de l’entourage (famille, amis, etc)": | ||
return <img src={house} alt="" />; | ||
case "Avec l’aide du CFA": | ||
case "Avec l’aide de l’ancien établissement": | ||
return <img src={school} alt="" />; | ||
case "Autrement (non précisé)": | ||
return <img src={search} alt="" />; | ||
case "Avec l’aide d’un éducateur ou d’une association": | ||
return <img src={community} alt="" />; | ||
case "Lors d'un événement sur l’orientation": | ||
return <img src={locationFrance} alt="" />; | ||
} | ||
}; | ||
|
||
const TrouverEntrepriseCard = ({ percentage, count, label, position, seeMore }) => { | ||
const { isMobile } = useBreakpoints(); | ||
const icon = getTrouverEntrepriseIcon(label); | ||
if (position > 3 && !seeMore) return null; | ||
return ( | ||
<TrouverEntrepriseCardContainer isMobile={isMobile}> | ||
{position <= 3 && <Position>{position}</Position>} | ||
{icon} | ||
<h5> | ||
{percentage}% <span>({count})</span> | ||
</h5> | ||
<p>{label}</p> | ||
</TrouverEntrepriseCardContainer> | ||
); | ||
}; | ||
|
||
const TrouverUneEntrepriseRating = ({ data, etablissementsCount }) => { | ||
const [seeMore, setSeeMore] = useState(false); | ||
|
||
return ( | ||
<TrouverUneEntrepriseRatingContainer> | ||
<div> | ||
<h4>Pour trouver une entreprise</h4> | ||
<DidYouKnowContainer> | ||
<img src={didYouKnow} alt="" /> | ||
<div> | ||
<h6>Le savais-tu ?</h6> | ||
<p> | ||
C’est le rôle du CFA de t’accompagner dans ton intégration et tes premiers pas dans le monde | ||
professionnel. N’hésite pas à le contacter pour trouver une entreprise ! | ||
</p> | ||
<p> | ||
Les entreprises qui recrutent sont aussi sur{" "} | ||
<a href="https://labonnealternance.apprentissage.beta.gouv.fr/" target="_blank" rel="noreferrer"> | ||
La Bonne Alternance | ||
</a> | ||
</p> | ||
</div> | ||
</DidYouKnowContainer> | ||
</div> | ||
<p>Pour cette formation, les apprentis ont trouvé une entreprise : </p> | ||
<CardsContainer> | ||
{data?.map((item, index) => ( | ||
<TrouverEntrepriseCard key={item.label} {...item} position={index + 1} seeMore={seeMore} /> | ||
))} | ||
</CardsContainer> | ||
<p onClick={() => setSeeMore((prevValue) => !prevValue)}> | ||
{seeMore ? "Voir moins" : "Voir plus"}{" "} | ||
<span className={fr.cx(seeMore ? "fr-icon-arrow-up-s-line" : "fr-icon-arrow-down-s-line")} /> | ||
</p> | ||
</TrouverUneEntrepriseRatingContainer> | ||
); | ||
}; | ||
|
||
export default TrouverUneEntrepriseRating; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters