diff --git a/__tests__/jest/getSkillBadgeColor.test.ts b/__tests__/jest/getSkillBadgeColor.test.ts index cd1e2eb4..93091d2a 100644 --- a/__tests__/jest/getSkillBadgeColor.test.ts +++ b/__tests__/jest/getSkillBadgeColor.test.ts @@ -1,26 +1,26 @@ import { getSkillBadgeColor } from '@/utils/getSkillBadgeColor' -import { CategoryDescriptionType } from '@/utils/types' +import { SkillCategoryType } from '@/utils/types' describe('getSkillBadgeColor', () => { it('returns "yellow" color for "Frontend"', () => { - expect(getSkillBadgeColor('Frontend' as CategoryDescriptionType)).toEqual('yellow') + expect(getSkillBadgeColor('Frontend' as SkillCategoryType)).toEqual('yellow') }) it('returns "indigo" color for "Design"', () => { - expect(getSkillBadgeColor('Design' as CategoryDescriptionType)).toEqual('indigo') + expect(getSkillBadgeColor('Design' as SkillCategoryType)).toEqual('indigo') }) it('return "lime" color for "Other"', () => { - expect(getSkillBadgeColor('Other' as CategoryDescriptionType)).toEqual('lime') + expect(getSkillBadgeColor('Other' as SkillCategoryType)).toEqual('lime') }) it('returns "neutral" for unknown category', () => { - const category: CategoryDescriptionType = 'unknown' as CategoryDescriptionType + const category: SkillCategoryType = 'unknown' as SkillCategoryType expect(getSkillBadgeColor(category)).toEqual('neutral') }) it('returns "neutral" for empty category', () => { - const category: CategoryDescriptionType = '' as CategoryDescriptionType + const category: SkillCategoryType = '' as SkillCategoryType expect(getSkillBadgeColor(category)).toEqual('neutral') }) }) diff --git a/app/error.tsx b/app/error.tsx index 558e81ee..a470ebe5 100644 --- a/app/error.tsx +++ b/app/error.tsx @@ -2,7 +2,7 @@ import { ErrorPageLayout } from '@/components/layout/ErrorPageLayout' import { ID } from '@/utils/constants' -import { ErrorProps } from '@/utils/types' +import { ErrorProps } from '@/utils/sharedComponentProps' export default function Error({ error, reset }: ErrorProps) { return ( diff --git a/app/global-error.tsx b/app/global-error.tsx index cfc1658d..474bc13a 100644 --- a/app/global-error.tsx +++ b/app/global-error.tsx @@ -2,7 +2,7 @@ import { ErrorPageLayout } from '@/components/layout/ErrorPageLayout' import { ID } from '@/utils/constants' -import { ErrorProps } from '@/utils/types' +import { ErrorProps } from '@/utils/sharedComponentProps' export default function GlobalError({ error, reset }: ErrorProps) { return ( diff --git a/components/NextPageNavigation.tsx b/components/NextPageNavigation.tsx index 0388f38a..f0963f5a 100644 --- a/components/NextPageNavigation.tsx +++ b/components/NextPageNavigation.tsx @@ -1,6 +1,6 @@ import { IconArrow } from '@/components/icons' -type Props = { +type NextPageNavigationProps = { pageLinkPrevious?: string pageNamePrevious?: string pageLinkNext?: string @@ -16,7 +16,7 @@ const NextPageNavigation = ({ pageNameNext, dataTestIDPrevious, dataTestIDNext, -}: Props) => { +}: NextPageNavigationProps) => { const hasPrevious = pageLinkPrevious && pageNamePrevious const hasNext = pageLinkNext && pageNameNext diff --git a/components/aboutMe/JobItem.tsx b/components/aboutMe/JobItem.tsx index 47fb8e31..7fed8042 100644 --- a/components/aboutMe/JobItem.tsx +++ b/components/aboutMe/JobItem.tsx @@ -1,13 +1,13 @@ import Image from 'next/image' -type Props = { +type JobItemProps = { path: string title: string description: string years: number } -const JobItem = ({ path, title, description, years }: Props) => { +const JobItem = ({ path, title, description, years }: JobItemProps) => { return (
  • diff --git a/components/header/ScrollProgressBar.tsx b/components/header/ScrollProgressBar.tsx index 84b2fde0..8c20bf6a 100644 --- a/components/header/ScrollProgressBar.tsx +++ b/components/header/ScrollProgressBar.tsx @@ -1,8 +1,8 @@ -type Props = { +type ScrollProgressBarProps = { scroll: number } -const ScrollProgressBar = ({ scroll }: Props) => { +const ScrollProgressBar = ({ scroll }: ScrollProgressBarProps) => { return
    } diff --git a/components/homepage/Skills.tsx b/components/homepage/Skills.tsx index dca1de85..9e1ca292 100644 --- a/components/homepage/Skills.tsx +++ b/components/homepage/Skills.tsx @@ -1,13 +1,9 @@ import DividerWithText from '@/components/shared/DividerWithText' import { iconsSkills1, iconsSkills2, iconsSkills3, iconsSkills4 } from '@/data/skills/skills-main' import { ID } from '@/utils/constants' +import { Icon } from '@/utils/interfaces' import Image from 'next/image' -interface Icon { - name: string - path: string -} - type SkillsIconGroupProps = { icons: Icon[] className?: string diff --git a/components/layout/ErrorPageLayout.tsx b/components/layout/ErrorPageLayout.tsx index 97ec8e21..a3ea9946 100644 --- a/components/layout/ErrorPageLayout.tsx +++ b/components/layout/ErrorPageLayout.tsx @@ -1,17 +1,24 @@ import PageContainer from '@/components/layout/PageContainer' import imgError from '@/public/images/illustrations/error.webp' -import { ErrorProps } from '@/utils/types' +import { ErrorProps } from '@/utils/sharedComponentProps' import Image from 'next/image' import { useEffect } from 'react' -type Props = { +type ErrorPageLayoutProps = { pageContainerId: string imgAlt: string textMain: string textSmall: string } & ErrorProps -export const ErrorPageLayout = ({ error, reset, pageContainerId, imgAlt, textMain, textSmall }: Props) => { +export const ErrorPageLayout = ({ + error, + reset, + pageContainerId, + imgAlt, + textMain, + textSmall, +}: ErrorPageLayoutProps) => { useEffect(() => { // Log the error to an error reporting service console.error(error) diff --git a/components/layout/PageContainer.tsx b/components/layout/PageContainer.tsx index 4da72dd1..f9d1410b 100644 --- a/components/layout/PageContainer.tsx +++ b/components/layout/PageContainer.tsx @@ -1,11 +1,11 @@ import React from 'react' -type props = { +type PageContainerProps = { id?: string children: React.ReactNode } -function PageContainer({ id, children }: props) { +function PageContainer({ id, children }: PageContainerProps) { return (
    {children}
    diff --git a/components/layout/ProjectsLayout.tsx b/components/layout/ProjectsLayout.tsx index 50398894..57af5420 100644 --- a/components/layout/ProjectsLayout.tsx +++ b/components/layout/ProjectsLayout.tsx @@ -1,12 +1,12 @@ import PageHeading from '@/components/shared/PageHeading' -type Props = { +type ProjectsLayoutProps = { heading: string description: string children: React.ReactNode } -const ProjectsLayout = ({ heading, description, children }: Props) => { +const ProjectsLayout = ({ heading, description, children }: ProjectsLayoutProps) => { return ( <>
    diff --git a/components/layout/projectPage/HeaderSection.tsx b/components/layout/projectPage/HeaderSection.tsx index 1efc353a..761de709 100644 --- a/components/layout/projectPage/HeaderSection.tsx +++ b/components/layout/projectPage/HeaderSection.tsx @@ -1,7 +1,7 @@ import { IconArrow } from '@/components/icons' import Heading2 from '@/components/shared/Heading2' import { getGoBackLinkID } from '@/utils/getGoBackLink' -import { HeaderSectionProps } from '@/utils/types' +import { HeaderSectionProps } from '@/utils/sharedComponentProps' import Link from 'next/link' const HeaderSection = ({ title, role, years, company, goBackLink, sectionID }: HeaderSectionProps) => { diff --git a/components/layout/projectPage/ProjectPageLayout.tsx b/components/layout/projectPage/ProjectPageLayout.tsx index 6955cd26..cded3bef 100644 --- a/components/layout/projectPage/ProjectPageLayout.tsx +++ b/components/layout/projectPage/ProjectPageLayout.tsx @@ -3,13 +3,14 @@ import HeaderSection from '@/components/layout/projectPage/HeaderSection' import Section from '@/components/layout/projectPage/Section' import ProjectInformation from '@/components/projects/ProjectInformation' import BreadCrumbs from '@/components/shared/Breadcrumbs' -import { BreadCrumbsType, HeaderSectionProps, ProjectInformationProps, SectionItem } from '@/utils/types' +import { HeaderSectionProps, ProjectInformationProps } from '@/utils/sharedComponentProps' +import { BreadCrumbsType } from '@/utils/types' import Image from 'next/image' -type Props = { +type ProjectPageLayoutProps = { breadCrumbs: BreadCrumbsType pageID: string - sections: SectionItem[] + sections: Section[] imageShowcase: string[] nextPageNavigation: React.ReactNode } & HeaderSectionProps & @@ -32,7 +33,7 @@ const ProjectPageLayout = ({ sections, imageShowcase, nextPageNavigation, -}: Props) => { +}: ProjectPageLayoutProps) => { return ( { +}: ProjectPageLayoutWrapperProps) => { const { title, role, years, company, description, mySkills, customers, projectLinks, imageShowcase } = projectData return ( diff --git a/components/layout/projectPage/Section.tsx b/components/layout/projectPage/Section.tsx index d9ca5748..5edc18db 100644 --- a/components/layout/projectPage/Section.tsx +++ b/components/layout/projectPage/Section.tsx @@ -1,8 +1,8 @@ import List from '@/components/shared/List' import ListItem from '@/components/shared/ListItem' -import { SectionItem } from '@/utils/types' +import { Section } from '@/utils/interfaces' -const Section = ({ title, titleHighlight, items }: SectionItem) => ( +const Section = ({ title, titleHighlight, items }: Section) => (

    {title} {titleHighlight && {titleHighlight}} diff --git a/components/projects/ProjectInformation.tsx b/components/projects/ProjectInformation.tsx index 7f344a2d..092c37f8 100644 --- a/components/projects/ProjectInformation.tsx +++ b/components/projects/ProjectInformation.tsx @@ -1,11 +1,15 @@ import List from '@/components/shared/List' import ListItem from '@/components/shared/ListItem' import { getSkillBadgeColor } from '@/utils/getSkillBadgeColor' -import { ProjectInformationProps } from '@/utils/types' +import { ProjectInformationProps } from '@/utils/sharedComponentProps' -type Props = ProjectInformationProps - -const ProjectInformation = ({ description, mySkills, customers, projectLinks, linkGitHub }: Props) => { +const ProjectInformation = ({ + description, + mySkills, + customers, + projectLinks, + linkGitHub, +}: ProjectInformationProps) => { const hasMoreLinks = projectLinks.length > 1 const hasGithub = linkGitHub ? true : false diff --git a/components/projects/ProjectItem.tsx b/components/projects/ProjectItem.tsx index 2c86441a..5afbf5e9 100644 --- a/components/projects/ProjectItem.tsx +++ b/components/projects/ProjectItem.tsx @@ -1,10 +1,10 @@ import { IconArrow } from '@/components/icons' import Heading2 from '@/components/shared/Heading2' import { getFeaturedBorderColor } from '@/utils/getFeaturedBorderColor' -import { Icon } from '@/utils/types' +import { Icon } from '@/utils/interfaces' import Image from 'next/image' -type Props = { +type ProjectItemProps = { isFeatured?: boolean | undefined image: string title: string @@ -32,7 +32,7 @@ const ProjectItem = ({ linkText, linkProjectPage, dataTestId, -}: Props) => { +}: ProjectItemProps) => { return (
    @@ -43,10 +43,7 @@ const ProjectItem = ({ {/* TODO: change to webp or avif format */} {title} { +const ExperienceCard = ({ company, role, isPartTime, description }: ExperienceCardProps) => { return (
    diff --git a/components/projects/experience/ExperienceSection.tsx b/components/projects/experience/ExperienceSection.tsx index 643895a1..01e26eb3 100644 --- a/components/projects/experience/ExperienceSection.tsx +++ b/components/projects/experience/ExperienceSection.tsx @@ -1,9 +1,9 @@ -type Props = { +type ExperienceSectionProps = { id: string text: string } -const ExperienceSection = ({ id, text }: Props) => { +const ExperienceSection = ({ id, text }: ExperienceSectionProps) => { return (
    {text} diff --git a/components/shared/Breadcrumbs.tsx b/components/shared/Breadcrumbs.tsx index 6ac88f07..52c31d10 100644 --- a/components/shared/Breadcrumbs.tsx +++ b/components/shared/Breadcrumbs.tsx @@ -2,7 +2,9 @@ import { IconCaretRight, IconHome } from '@/components/icons' import { BreadCrumbsType } from '@/utils/types' import Link from 'next/link' -const BreadCrumbs = ({ linkLevel1, textLevel1, linkLevel2, textLevel2 }: BreadCrumbsType) => { +type BreadCrumbsProps = BreadCrumbsType + +const BreadCrumbs = ({ linkLevel1, textLevel1, linkLevel2, textLevel2 }: BreadCrumbsProps) => { return ( <>