diff --git a/components/SkillsMain.tsx b/components/SkillsMain.tsx index 779677d1..afcdc922 100644 --- a/components/SkillsMain.tsx +++ b/components/SkillsMain.tsx @@ -4,15 +4,16 @@ import js from '@/public/icons/svg/skills/js.svg' import react from '@/public/icons/svg/skills/react.svg' import ts from '@/public/icons/svg/skills/ts.svg' import { ID_SKILLS_MAIN } from '@/utils/constants' +import { getYearsExperience } from '@/utils/getYearsExperience' const SkillsSection1 = () => { return (
@@ -24,19 +25,19 @@ const SkillsSection2 = () => {
diff --git a/components/shared/Card.tsx b/components/shared/Card.tsx index c1ef61f1..0b450e4e 100644 --- a/components/shared/Card.tsx +++ b/components/shared/Card.tsx @@ -1,21 +1,21 @@ import Image, { StaticImageData } from 'next/image' type Props = { - src: StaticImageData - alt: string + imgSrc: StaticImageData + imgAlt: string title: string + titleYears: string description: string - titleHighlight: string } -const Card = ({ src, alt, title, titleHighlight, description }: Props) => ( +const Card = ({ imgSrc, imgAlt, title, titleYears, description }: Props) => (
- {alt} + {imgAlt}
{title}{' '} - {titleHighlight && ( + {titleYears && ( - {' · '} {titleHighlight} + {' · '} {titleYears} years )}
diff --git a/utils/getYearsExperience.ts b/utils/getYearsExperience.ts new file mode 100644 index 00000000..fb3bee5b --- /dev/null +++ b/utils/getYearsExperience.ts @@ -0,0 +1,3 @@ +export const getYearsExperience = (startYear: number): number => { + return new Date().getFullYear() - startYear +}