From 479c9da13893a17949b4c9156c70e687cd264aa2 Mon Sep 17 00:00:00 2001 From: Joseph Burdick Date: Tue, 4 Jun 2024 20:26:44 -0400 Subject: [PATCH] Add experience types --- src/app/page.tsx | 1 + src/components/global/LogoMarquee.tsx | 5 +++-- src/lib/types/experience.ts | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/lib/types/experience.ts diff --git a/src/app/page.tsx b/src/app/page.tsx index 6ecc658..92556a2 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,6 +2,7 @@ import { DeviceProvider } from "@/lib/providers/DeviceContext" import { DataProvider } from "@/lib/providers/DataProvider" import getData from "@/data/index" import Intro from "./_content/Intro" + export default async function Home() { const data = await getData() diff --git a/src/components/global/LogoMarquee.tsx b/src/components/global/LogoMarquee.tsx index a24094d..c2e9258 100644 --- a/src/components/global/LogoMarquee.tsx +++ b/src/components/global/LogoMarquee.tsx @@ -1,5 +1,6 @@ import { useData } from "@/lib/providers/DataProvider" import { cn } from "@/lib/utils" +import { Job } from "@/lib/types/experience" type MarqueeProps = { itemWidth?: string; }; @@ -8,8 +9,8 @@ const logoPath = "/j0e/assets/images/logos/" export default function LogoMarquee(props: MarqueeProps) { const { itemWidth = "200px" } = props const { data } = useData() - const jobs = data.experience.attributes.experience.filter( - (job) => !!job.logo, + const jobs: Job[] = data.experience.attributes.experience.filter( + (job: Job) => !!job.logo, ) return ( diff --git a/src/lib/types/experience.ts b/src/lib/types/experience.ts new file mode 100644 index 0000000..f186797 --- /dev/null +++ b/src/lib/types/experience.ts @@ -0,0 +1,18 @@ +export interface Role { + title: string; + type: string; + start_date: string; + end_date: string | null; + duration: string; + location?: string; + description: string; + skills: string[]; +} + +export interface Job { + company: string; + location: string; + logo?: string; + visible?: boolean; + roles: Role[]; +}