generated from WildCodeSchool/create-js-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of github.com:WildCodeSchool/2023-09-JS-BDX-P3-La_…
…Rive_Droite into front_profile Co-authored-by: Marie Delaire <[email protected]>
- Loading branch information
Showing
23 changed files
with
648 additions
and
379 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,72 @@ | ||
import PropTypes from "prop-types"; | ||
import { format } from "date-fns"; | ||
|
||
import "./card-model.css"; | ||
|
||
function CardExperience({ | ||
id, | ||
title, | ||
company, | ||
type, | ||
city, | ||
dateBegin, | ||
dateEnd, | ||
description, | ||
handleExperienceDelete, | ||
}) { | ||
const trimText = (chaine, limite) => { | ||
if (chaine.length <= limite) { | ||
return chaine; | ||
} | ||
return `${chaine.slice(0, limite)}...`; | ||
}; | ||
|
||
const dateBeginObject = new Date(dateBegin); | ||
const dateEndObject = new Date(dateEnd); | ||
|
||
// Formater les dates selon le modèle souhaité | ||
const formattedDateBegin = format(dateBeginObject, "dd/MM/yyyy"); | ||
const formattedDateEnd = format(dateEndObject, "dd/MM/yyyy"); | ||
return ( | ||
<div className="card-container"> | ||
<div className="card-icons"> | ||
<div className="icon-view"> | ||
<button | ||
className="invisible-button" | ||
aria-label="toggleFavorite" | ||
type="button" | ||
onClick={() => { | ||
handleExperienceDelete(id); | ||
}} | ||
> | ||
<i className="fa-solid fa-trash-can" /> | ||
</button> | ||
</div> | ||
</div> | ||
<h4 className="date-poste"> | ||
{formattedDateBegin} au {formattedDateEnd} | ||
</h4> | ||
<h3 className="label-offre">{title}</h3> | ||
<h4 className="entreprise-champs experience"> | ||
{company} {city} | ||
</h4> | ||
<h5 className="poste-champs experience"> | ||
{type} - {city} | ||
</h5> | ||
<p className="p-description ">{trimText(description, 250)}</p> | ||
</div> | ||
); | ||
} | ||
CardExperience.propTypes = { | ||
id: PropTypes.number.isRequired, | ||
title: PropTypes.string.isRequired, | ||
company: PropTypes.string.isRequired, | ||
type: PropTypes.string.isRequired, | ||
city: PropTypes.string.isRequired, | ||
dateBegin: PropTypes.string.isRequired, | ||
dateEnd: PropTypes.string.isRequired, | ||
description: PropTypes.string.isRequired, | ||
handleExperienceDelete: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default CardExperience; |
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 |
---|---|---|
@@ -1,22 +1,63 @@ | ||
import "./card-model.css"; | ||
// import axios from "axios"; | ||
import { format } from "date-fns"; | ||
import PropTypes from "prop-types"; | ||
|
||
function CardFormation({ | ||
id, | ||
domaine, | ||
dateBegin, | ||
dateEnd, | ||
name, | ||
level, | ||
handleCourseDelete, | ||
}) { | ||
const dateBeginObject = dateBegin ? new Date(dateBegin) : null; | ||
const dateEndObject = dateEnd ? new Date(dateEnd) : null; | ||
|
||
// Formater les dates selon le modèle souhaité | ||
const formattedDateBegin = dateBeginObject | ||
? format(dateBeginObject, "dd/MM/yyyy") | ||
: "Date début invalide"; | ||
const formattedDateEnd = dateEndObject | ||
? format(dateEndObject, "dd/MM/yyyy") | ||
: "Date fin invalide"; | ||
|
||
function CardFormation() { | ||
// const Course = async () => { | ||
// try { | ||
// // const data = | ||
// await axios.get(`http://localhost:3310/api/course/`); | ||
// } catch (err) { | ||
// console.error(err); | ||
// } | ||
// }; | ||
return ( | ||
<div className="card-container"> | ||
<h3 className="diplome">Master 1</h3> | ||
<h4 className="dates">11/07/2023 - 25/02/2024</h4> | ||
<p className="school">Wild Code School - Bordeaux</p> | ||
<div className="card-icons"> | ||
<div className="icon-view"> | ||
<button | ||
className="invisible-button" | ||
aria-label="toggleFavorite" | ||
type="button" | ||
onClick={() => { | ||
handleCourseDelete(id); | ||
}} | ||
> | ||
<i className="fa-solid fa-trash-can" /> | ||
</button> | ||
</div> | ||
</div> | ||
<h4 className="date-poste"> | ||
{formattedDateBegin} au {formattedDateEnd} | ||
</h4> | ||
<h3 className="label-offre "> | ||
{level} | ||
{domaine} | ||
</h3> | ||
|
||
<p className="entreprise-champs formation ">{name}</p> | ||
</div> | ||
); | ||
} | ||
CardFormation.propTypes = { | ||
id: PropTypes.number.isRequired, | ||
domaine: PropTypes.string.isRequired, | ||
dateBegin: PropTypes.string.isRequired, | ||
dateEnd: PropTypes.string.isRequired, | ||
name: PropTypes.string.isRequired, | ||
level: PropTypes.string.isRequired, | ||
handleCourseDelete: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default CardFormation; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ | |
} | ||
.navbar-link:hover { | ||
transform: scale(0.9); | ||
color: white; | ||
} | ||
.active { | ||
color: white; | ||
|
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
Oops, something went wrong.