-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
255 additions
and
19 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,64 @@ | ||
import { useTranslation } from "react-i18next"; | ||
|
||
import ArrowDownSvg from "../../assets/icons/arrow-down.svg"; | ||
import ArrowUpSvg from "../../assets/icons/arrow-up.svg"; | ||
import Typography from "../Typography"; | ||
import styles from "./styles.module.css"; | ||
|
||
interface ExperienceCardProps { | ||
title: string; | ||
company: string; | ||
startDate: Date; | ||
endDate?: Date; | ||
active?: boolean; | ||
hasOpenIcon?: boolean; | ||
onClick?: () => void; | ||
} | ||
|
||
export default function ExperienceCard({ | ||
title, | ||
company, | ||
startDate, | ||
endDate, | ||
active, | ||
hasOpenIcon, | ||
onClick, | ||
}: ExperienceCardProps) { | ||
const { t, i18n } = useTranslation(); | ||
|
||
const startDateFormatted = new Intl.DateTimeFormat(i18n.language, { | ||
month: "2-digit", | ||
year: "numeric", | ||
}).format(startDate); | ||
const endDateFormatted = endDate | ||
? new Intl.DateTimeFormat(i18n.language, { | ||
month: "2-digit", | ||
year: "numeric", | ||
}).format(endDate) | ||
: t(`general.current.label`); | ||
|
||
return ( | ||
<li | ||
className={`${styles["experience"]} ${active ? styles["experience--active"] : ""}`} | ||
onClick={onClick} | ||
> | ||
<div className={styles["experience-content"]}> | ||
<Typography variant="caption2">{`${startDateFormatted} - ${endDateFormatted}`}</Typography> | ||
<div className={styles["experience-company"]}> | ||
<Typography variant="body1">{company}</Typography> | ||
<Typography variant="body2"> | ||
{t(`data.experiences.${title}.location.label`)} | ||
</Typography> | ||
</div> | ||
<Typography variant="body3"> | ||
{t(`data.experiences.${title}.position.label`)} | ||
</Typography> | ||
</div> | ||
{hasOpenIcon && ( | ||
<div className={styles["experience-open_icon"]}> | ||
{active ? <ArrowUpSvg /> : <ArrowDownSvg />} | ||
</div> | ||
)} | ||
</li> | ||
); | ||
} |
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,37 @@ | ||
.experience { | ||
width: 100%; | ||
padding: 0.5rem; | ||
border-radius: 0.5rem; | ||
display: flex; | ||
align-items: center; | ||
cursor: pointer; | ||
} | ||
|
||
.experience--active { | ||
background-color: var(--primary-transparent); | ||
} | ||
|
||
.experience-content { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
} | ||
|
||
.experience-company { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
} | ||
|
||
.experience-open_icon { | ||
width: 2.5rem; | ||
height: 2.5rem; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.experience-open_icon svg path { | ||
fill: var(--primary); | ||
} |
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
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.