Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Antony1060 committed Sep 21, 2024
1 parent 35cfef7 commit 8c5a2f6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"typescript": "^5.0.2",
"vite": "^4.2.1",
"vite-plugin-compression": "^0.5.1"
}
},
"packageManager": "pnpm@9.10.0+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c"
}
10 changes: 6 additions & 4 deletions src/components/parts/education/Education.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const Container = styled.div`
display: flex;
justify-content: stretch;
align-items: center;
padding: 1rem 2rem;
padding-bottom: 2.4rem;
padding: 1rem 2rem 2.4rem;
`;

export type EducationStatus = "passed" | "active" | "future";
Expand Down Expand Up @@ -115,8 +114,11 @@ const Education: FC = () => {
name: "Algebra University",
location: "Zagreb, Croatia",
years: 3,
degree: "Bachelors",
progress: Percent(+(UNI_ECTS / UNI_ECTS_MAX).toFixed(2)),
degree: {
type: "Bachelors",
study: "computer engineering",
},
progress: Percent(+(UNI_ECTS / UNI_ECTS_MAX)),
}}
/>
</Container>
Expand Down
17 changes: 11 additions & 6 deletions src/components/parts/education/EducationPoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ type EducationDetail = {
name: string;
location: string;
years: number;
degree?: "Bachelors" | "Masters" | "PhD";
degree?: {
type: "Bachelors" | "Masters" | "PhD";
study: string;
};
progress: number;
};

Expand All @@ -175,15 +178,13 @@ type EducationPointProperties = {
description: string;
detail?: EducationDetail;
descriptionAlignment?: Alignment;
uncertaint?: boolean;
};

const EducationPoint: FC<EducationPointProperties> = ({
status,
description,
detail,
descriptionAlignment,
uncertaint,
}) => {
const progressPercent = detail ? detail.progress * 100 : undefined;

Expand All @@ -192,22 +193,26 @@ const EducationPoint: FC<EducationPointProperties> = ({
{status === "active" && <RadarEffect />}
<Description alignment={descriptionAlignment ?? "center"}>{description}</Description>
<Detail status={status}>
{!detail || isNullish(progressPercent) || uncertaint ? (
{!detail || isNullish(progressPercent) ? (
<span style={{ padding: "0.6rem", textAlign: "center", fontSize: "1rem" }}>
Unknown so far...
</span>
) : (
<>
<DetailTitle>
<span>{detail.name}</span>
{detail.degree && <Degree>{detail.degree}</Degree>}
{detail.degree && (
<Degree>
{detail.degree.type} ({detail.degree.study})
</Degree>
)}
<Location>{detail.location}</Location>
</DetailTitle>
<DetailContent>
<div>
<ProgressIndicator>
{progressPercent !== 100
? progressPercent + "% done"
? progressPercent.toFixed(2) + "% done"
: "Completed"}{" "}
</ProgressIndicator>
<span>{detail.years} years</span>
Expand Down

0 comments on commit 8c5a2f6

Please sign in to comment.