From b165bb7d1247d76dc4c14d39c37f9719df3acce4 Mon Sep 17 00:00:00 2001 From: Krsiak Daniel Date: Mon, 23 Dec 2024 19:53:12 +0100 Subject: [PATCH] =?UTF-8?q?refactor(index.ts):=20=F0=9F=91=B7=20Use=20dire?= =?UTF-8?q?ct=20imports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/personal-projects/page.tsx | 3 +- components/about-me/JobItem.tsx | 2 +- components/header/menu/MenuToggle.tsx | 3 +- components/icons/index.ts | 8 ----- components/layout/project-page/Gallery.tsx | 2 +- .../layout/project-page/HeaderSection.tsx | 2 +- .../page-navigation/PageNavigationLink.tsx | 2 +- .../projects/overview-page/ProjectItem.tsx | 2 +- components/shared/Breadcrumbs.tsx | 2 +- components/shared/HighlightedText.tsx | 2 +- components/shared/ListItem.tsx | 2 +- .../personal/projects-overview/index.ts | 2 -- data/projects/work/projects-overview/index.ts | 5 ---- data/statusPage/index.ts | 30 +++++++++++-------- utils/interfaces/interfaces.ts | 9 ++++++ 15 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 components/icons/index.ts delete mode 100644 data/projects/personal/projects-overview/index.ts delete mode 100644 data/projects/work/projects-overview/index.ts diff --git a/app/personal-projects/page.tsx b/app/personal-projects/page.tsx index 28fe3237..d38f3c86 100644 --- a/app/personal-projects/page.tsx +++ b/app/personal-projects/page.tsx @@ -3,7 +3,8 @@ import ProjectsLayout from '@/components/layout/ProjectsLayout' import PageNavigation from '@/components/page-navigation/PageNavigation' import { ProjectSection } from '@/components/projects/overview-page/ProjectSection' import BreadCrumbs from '@/components/shared/Breadcrumbs' -import { projectsPersonalNext, projectsPersonalReact } from '@/data/projects/personal/projects-overview' +import { projectsPersonalNext } from '@/data/projects/personal/projects-overview/personalNext' +import { projectsPersonalReact } from '@/data/projects/personal/projects-overview/personalReact' import { TEXT } from '@/localization/english' import { DATA_TEST_IDS } from '@/utils/constants/ids/dataTestIds' import { ID } from '@/utils/constants/ids/elementIds' diff --git a/components/about-me/JobItem.tsx b/components/about-me/JobItem.tsx index 824af771..12e2dc65 100644 --- a/components/about-me/JobItem.tsx +++ b/components/about-me/JobItem.tsx @@ -8,7 +8,7 @@ type JobItemProps = { years: number } -interface JobIconProps { +type JobIconProps = { path: string title: string } diff --git a/components/header/menu/MenuToggle.tsx b/components/header/menu/MenuToggle.tsx index 796201d1..f6c5492c 100644 --- a/components/header/menu/MenuToggle.tsx +++ b/components/header/menu/MenuToggle.tsx @@ -1,6 +1,7 @@ 'use client' // using onClick -import { IconClose, IconHamburger } from '@/components/icons' +import { IconClose } from '@/components/icons/IconClose' +import { IconHamburger } from '@/components/icons/IconHamburger' import { DATA_TEST_IDS } from '@/utils/constants/ids/dataTestIds' import { ID } from '@/utils/constants/ids/elementIds' diff --git a/components/icons/index.ts b/components/icons/index.ts deleted file mode 100644 index 4a8ec1c7..00000000 --- a/components/icons/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IconArrow } from './IconArrow' -import { IconCaretRight } from './IconCaretRight' -import { IconCheck } from './IconCheck' -import { IconClose } from './IconClose' -import { IconHamburger } from './IconHamburger' -import { IconHome } from './IconHome' - -export { IconArrow, IconCaretRight, IconCheck, IconClose, IconHamburger, IconHome } diff --git a/components/layout/project-page/Gallery.tsx b/components/layout/project-page/Gallery.tsx index e78347c7..ef11995c 100644 --- a/components/layout/project-page/Gallery.tsx +++ b/components/layout/project-page/Gallery.tsx @@ -2,7 +2,7 @@ import { DATA_TEST_IDS } from '@/utils/constants/ids/dataTestIds' import { ImageShowcaseItem } from '@/utils/interfaces/interfaces' import Image from 'next/image' -interface GalleryProps { +type GalleryProps = { imageShowcase: ImageShowcaseItem[] } diff --git a/components/layout/project-page/HeaderSection.tsx b/components/layout/project-page/HeaderSection.tsx index d088b43f..86dffe29 100644 --- a/components/layout/project-page/HeaderSection.tsx +++ b/components/layout/project-page/HeaderSection.tsx @@ -1,4 +1,4 @@ -import { IconArrow } from '@/components/icons' +import { IconArrow } from '@/components/icons/IconArrow' import Heading1 from '@/components/shared/Heading1' import Heading2 from '@/components/shared/Heading2' import { getGoBackLinkID } from '@/utils/helpers/getGoBackLink' diff --git a/components/page-navigation/PageNavigationLink.tsx b/components/page-navigation/PageNavigationLink.tsx index c57aa64d..8241b518 100644 --- a/components/page-navigation/PageNavigationLink.tsx +++ b/components/page-navigation/PageNavigationLink.tsx @@ -1,4 +1,4 @@ -import { IconArrow } from '@/components/icons' +import { IconArrow } from '@/components/icons/IconArrow' const LEFT = 'left' const RIGHT = 'right' diff --git a/components/projects/overview-page/ProjectItem.tsx b/components/projects/overview-page/ProjectItem.tsx index 2f54bd42..94a55389 100644 --- a/components/projects/overview-page/ProjectItem.tsx +++ b/components/projects/overview-page/ProjectItem.tsx @@ -1,4 +1,4 @@ -import { IconArrow } from '@/components/icons' +import { IconArrow } from '@/components/icons/IconArrow' import Heading2 from '@/components/shared/Heading2' import { Icon } from '@/utils/interfaces/interfaces' import Image from 'next/image' diff --git a/components/shared/Breadcrumbs.tsx b/components/shared/Breadcrumbs.tsx index c14ea874..4bb3d8ed 100644 --- a/components/shared/Breadcrumbs.tsx +++ b/components/shared/Breadcrumbs.tsx @@ -1,4 +1,4 @@ -import { IconCaretRight } from '@/components/icons' +import { IconCaretRight } from '@/components/icons/IconCaretRight' import { DATA_TEST_IDS } from '@/utils/constants/ids/dataTestIds' import { BreadCrumbsType } from '@/utils/interfaces/types' import Link from 'next/link' diff --git a/components/shared/HighlightedText.tsx b/components/shared/HighlightedText.tsx index 0d4ba088..16b09412 100644 --- a/components/shared/HighlightedText.tsx +++ b/components/shared/HighlightedText.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react' -interface HighlightedTextProps { +type HighlightedTextProps = { children: ReactNode } diff --git a/components/shared/ListItem.tsx b/components/shared/ListItem.tsx index e919bfb7..c7585dfa 100644 --- a/components/shared/ListItem.tsx +++ b/components/shared/ListItem.tsx @@ -1,4 +1,4 @@ -import { IconCheck } from '@/components/icons' +import { IconCheck } from '@/components/icons/IconCheck' type ListItemProps = { children: React.ReactNode diff --git a/data/projects/personal/projects-overview/index.ts b/data/projects/personal/projects-overview/index.ts deleted file mode 100644 index 5b481837..00000000 --- a/data/projects/personal/projects-overview/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './personalNext' -export * from './personalReact' diff --git a/data/projects/work/projects-overview/index.ts b/data/projects/work/projects-overview/index.ts deleted file mode 100644 index f491719f..00000000 --- a/data/projects/work/projects-overview/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './workFrontEnd' -export * from './workLocalization' -export * from './workQA' -export * from './workReact' -export * from './workWordpress' diff --git a/data/statusPage/index.ts b/data/statusPage/index.ts index 25a2e2a7..7330156d 100644 --- a/data/statusPage/index.ts +++ b/data/statusPage/index.ts @@ -1,50 +1,54 @@ -interface StatusBadge { - name: string - src: string - alt: string - width: number - height: number -} +import { StatusBadge } from '@/utils/interfaces/interfaces' + +const IMAGE_JEST_TESTS = + 'https://github.com/krsiakdaniel/portfolio-website-krsiak-cz/actions/workflows/jest.yml/badge.svg' +const IMAGE_PLAYWRIGHT_TESTS = + 'https://github.com/krsiakdaniel/portfolio-website-krsiak-cz/actions/workflows/playwright.yml/badge.svg' +const IMAGE_CODEQL = + 'https://github.com/krsiakdaniel/portfolio-website-krsiak-cz/actions/workflows/github-code-scanning/codeql/badge.svg' +const IMAGE_CODE_QUALITY = 'https://app.codacy.com/project/badge/Grade/eaa72f9b0a7242ae9179b0dfdd58faf5' +const IMAGE_DEPENDABOT = 'https://img.shields.io/badge/Dependabot-Enabled-green' +const IMAGE_NETLIFY = 'https://api.netlify.com/api/v1/badges/eb322254-0169-4941-9416-3806b0bd5be6/deploy-status' export const statusBadges: StatusBadge[] = [ { name: 'Jest Tests', - src: 'https://github.com/krsiakdaniel/portfolio-website-krsiak-cz/actions/workflows/jest.yml/badge.svg', + src: IMAGE_JEST_TESTS, alt: 'Jest Tests', width: 132, height: 20, }, { name: 'Playwright Tests', - src: 'https://github.com/krsiakdaniel/portfolio-website-krsiak-cz/actions/workflows/playwright.yml/badge.svg', + src: IMAGE_PLAYWRIGHT_TESTS, alt: 'Playwright Tests', width: 167, height: 20, }, { name: 'CodeQL', - src: 'https://github.com/krsiakdaniel/portfolio-website-krsiak-cz/actions/workflows/github-code-scanning/codeql/badge.svg', + src: IMAGE_CODEQL, alt: 'CodeQL', width: 120, height: 40, }, { name: 'Code Quality', - src: 'https://app.codacy.com/project/badge/Grade/eaa72f9b0a7242ae9179b0dfdd58faf5', + src: IMAGE_CODE_QUALITY, alt: 'Code Quality', width: 120, height: 20, }, { name: 'Dependabot', - src: 'https://img.shields.io/badge/Dependabot-Enabled-green', + src: IMAGE_DEPENDABOT, alt: 'Dependabot', width: 130, height: 20, }, { name: 'Netlify', - src: 'https://api.netlify.com/api/v1/badges/eb322254-0169-4941-9416-3806b0bd5be6/deploy-status', + src: IMAGE_NETLIFY, alt: 'Netlify', width: 118, height: 20, diff --git a/utils/interfaces/interfaces.ts b/utils/interfaces/interfaces.ts index 2343aa1f..5676d475 100644 --- a/utils/interfaces/interfaces.ts +++ b/utils/interfaces/interfaces.ts @@ -81,3 +81,12 @@ export interface SkillCard { years: number description: string } + +// status page +export interface StatusBadge { + name: string + src: string + alt: string + width: number + height: number +}