Skip to content

Commit

Permalink
feat(home): add experience in home
Browse files Browse the repository at this point in the history
  • Loading branch information
LaercioSR committed Sep 25, 2024
1 parent b8e959c commit 39c4e0b
Show file tree
Hide file tree
Showing 8 changed files with 255 additions and 19 deletions.
3 changes: 3 additions & 0 deletions src/app/assets/icons/arrow-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions src/app/components/ExperienceCard/index.tsx
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>
);
}
37 changes: 37 additions & 0 deletions src/app/components/ExperienceCard/styles.module.css
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);
}
2 changes: 2 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
--tertiary: #e88d8d;
--background: #fff4f4;
--home: #ebd5d2;
--primary-transparent: #6600001a;

--shadow: 4px 8px 16px 0px rgba(0, 0, 0, 0.25);

Expand All @@ -16,6 +17,7 @@
--tertiary: #804646;
--background: #120000;
--home: #400000;
--primary-transparent: #fefefe1a;
}

* {
Expand Down
15 changes: 10 additions & 5 deletions src/app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
}
},
"profile": {
"role": "Software Engineer"
"position": "Software Engineer"
},
"general": {
"current": {
"label": "Current"
}
},
"components": {
"buyMeACoffee": {
Expand Down Expand Up @@ -84,7 +89,7 @@
},
"experiences": {
"geodatin": {
"role": {
"position": {
"label": "Fullstack Developer"
},
"location": {
Expand All @@ -95,11 +100,11 @@
}
},
"golfarma": {
"role": {
"position": {
"label": "Backend Developer (Intern)"
},
"location": {
"label": "Remote/On-site (Feira de Santana, Brazil)"
"label": "Hybrid (Feira de Santana, Brazil)"
},
"description": {
"label": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sit amet egestas diam. Donec eget convallis ex. Cras nec leo risus. Nunc finibus lorem risus, id fermentum urna tempus eu.\n\nDonec id iaculis dui. Nulla sit amet euismod velit. Donec sed quam sit amet elit eleifend elementum. Morbi pellentesque ligula vel faucibus commodo. Aenean rhoncus varius ligula ut cursus. Duis congue pellentesque rutrum."
Expand Down Expand Up @@ -178,4 +183,4 @@
}
}
}
}
}
19 changes: 12 additions & 7 deletions src/app/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
}
},
"profile": {
"role": "Desenvolvedor de Software"
"position": "Desenvolvedor de Software"
},
"general": {
"current": {
"label": "Atual"
}
},
"components": {
"buyMeACoffee": {
Expand Down Expand Up @@ -84,25 +89,25 @@
},
"experiences": {
"geodatin": {
"role": {
"position": {
"label": "Desenvolvedor Fullstack"
},
"location": {
"label": "Remoto (Feira de Santana - BA)"
},
"description": {
"label": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sit amet egestas diam. Donec eget convallis ex. Cras nec leo risus. Nunc finibus lorem risus, id fermentum urna tempus eu.\n\nDonec id iaculis dui. Nulla sit amet euismod velit. Donec sed quam sit amet elit eleifend elementum. Morbi pellentesque ligula vel faucibus commodo. Aenean rhoncus varius ligula ut cursus. Duis congue pellentesque rutrum."
"label": "Geodatin - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sit amet egestas diam. Donec eget convallis ex. Cras nec leo risus. Nunc finibus lorem risus, id fermentum urna tempus eu.\n\nDonec id iaculis dui. Nulla sit amet euismod velit. Donec sed quam sit amet elit eleifend elementum. Morbi pellentesque ligula vel faucibus commodo. Aenean rhoncus varius ligula ut cursus. Duis congue pellentesque rutrum."
}
},
"golfarma": {
"role": {
"position": {
"label": "Desenvolvedor Backend (Estágio)"
},
"location": {
"label": "Remoto/Presencial (Feira de Santana - BA)"
"label": "Híbrido (Feira de Santana - BA)"
},
"description": {
"label": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sit amet egestas diam. Donec eget convallis ex. Cras nec leo risus. Nunc finibus lorem risus, id fermentum urna tempus eu.\n\nDonec id iaculis dui. Nulla sit amet euismod velit. Donec sed quam sit amet elit eleifend elementum. Morbi pellentesque ligula vel faucibus commodo. Aenean rhoncus varius ligula ut cursus. Duis congue pellentesque rutrum."
"label": "Golfarma - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sit amet egestas diam. Donec eget convallis ex. Cras nec leo risus. Nunc finibus lorem risus, id fermentum urna tempus eu.\n\nDonec id iaculis dui. Nulla sit amet euismod velit. Donec sed quam sit amet elit eleifend elementum. Morbi pellentesque ligula vel faucibus commodo. Aenean rhoncus varius ligula ut cursus. Duis congue pellentesque rutrum."
}
}
},
Expand Down Expand Up @@ -178,4 +183,4 @@
}
}
}
}
}
48 changes: 48 additions & 0 deletions src/app/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,54 @@
}
}

.experience-content {
display: none;

@media (min-width: 1024px) {
display: flex;
gap: 2rem;
}
}

.experience-summary {
width: 100%;
display: flex;
flex-direction: column;
gap: 1rem;
}

.experience-summary h4,
.experience-summary p {
text-align: left;
}

.experience-list {
min-width: 22rem;
list-style-type: none;
display: flex;
flex-direction: column;
gap: 1rem;
}

.experience-nested_list {
list-style-type: none;
display: flex;
flex-direction: column;
gap: 1rem;

@media (min-width: 1024px) {
display: none;
}
}
.experience-nested_list li {
border-radius: 0.5rem;
background-color: var(--primary-transparent);
}

.experience-nested_list li > p {
padding: 0.5rem;
}

.formation-list {
list-style-type: none;
width: 100%;
Expand Down
Loading

0 comments on commit 39c4e0b

Please sign in to comment.