Skip to content

Commit

Permalink
refactor(constants): 👷 urls-texts-emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
krsiakdaniel committed Dec 15, 2024
1 parent 527c647 commit 1b41651
Show file tree
Hide file tree
Showing 21 changed files with 123 additions and 89 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ I follow a structured approach to identify and resolve unexpected issues.

Explore the linked issue to see how I apply this in practice: [Fix(Heading1)!: 🐛 Incorrect Text Size on Production Compared to Localhost](https://github.com/users/krsiakdaniel/projects/6/views/1?pane=issue&itemId=90896673&issue=krsiakdaniel%7Cportfolio-website-krsiak-cz%7C163)


## 🚦 Project Status

The current status of the project is continuously monitored.
Expand Down
6 changes: 4 additions & 2 deletions __tests__/playwright/about-me/aboutMe.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { getDataTestId } from '@/__tests__/playwright/utils/getDataTestId'
import { TEXT } from '@/localization/texts_en'
import { PAGES_URL } from '@/utils/constants'
import { DATA_TEST_IDS } from '@/utils/dataTestIds'
import { expect, test } from '@playwright/test'

test.describe('About Me Page - Tests', () => {
test('Heading + text', async ({ page }) => {
await test.step('Go to page About me', async () => {
await page.goto('/about-me')
await page.goto(PAGES_URL.aboutMe)
})

await test.step('Check that the Heading text is correct', async () => {
const heading = await page.textContent('h1')
expect(heading).toBe('👨‍💻 About Me')
expect(heading).toBe(TEXT.aboutMe)
})

await test.step('Check that the paragraph text is correct', async () => {
Expand Down
10 changes: 5 additions & 5 deletions app/about-me/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const metadata: Metadata = {
const About = () => {
return (
<PageContainer id={ID.about}>
<BreadCrumbs linkLevel1={PAGES_URL.aboutMe} textLevel1="About Me" />
<BreadCrumbs linkLevel1={PAGES_URL.aboutMe} textLevel1={TEXT.aboutMe} />
<div>
<HeadingInfo />
<div className="mt-16 flex flex-col-reverse justify-between lg:flex-row lg:space-x-10">
Expand All @@ -46,11 +46,11 @@ const About = () => {
</div>
</div>
<PageNavigation
linkPrevious="/"
namePrevious="Home"
linkPrevious={PAGES_URL.home}
namePrevious={TEXT.home}
dataTestIdPrevious={DATA_TEST_IDS.page.aboutMe.previous}
linkNext="/resume"
nameNext="Resume"
linkNext={PAGES_URL.resume}
nameNext={TEXT.resume}
dataTestIdNext={DATA_TEST_IDS.page.aboutMe.next}
/>
</PageContainer>
Expand Down
9 changes: 6 additions & 3 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import WhatIDoMindset from '@/components/homepage/WhatIDoMindset'
import PageContainer from '@/components/layout/PageContainer'
import PageNavigation from '@/components/pageNavigation/PageNavigation'
import { TEXT } from '@/localization/texts_en'
import { ID } from '@/utils/constants'
import { ID, PAGES_URL } from '@/utils/constants'
import { DATA_TEST_IDS } from '@/utils/dataTestIds'
import { Metadata } from 'next'

Expand Down Expand Up @@ -41,8 +41,11 @@ const Page = () => {
<SkillsMain />
<WhatIDoMindset />

{/* TODO: refactor for all pages into constants, urls, text, test IDs */}
<PageNavigation linkNext="/about-me" nameNext="About Me" dataTestIdNext={DATA_TEST_IDS.page.home.next} />
<PageNavigation
linkNext={PAGES_URL.aboutMe}
nameNext={TEXT.aboutMe}
dataTestIdNext={DATA_TEST_IDS.page.home.next}
/>
</PageContainer>
)
}
Expand Down
9 changes: 4 additions & 5 deletions app/personal-projects/cryptomania/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export const metadata: Metadata = {

const breadCrumbs: BreadCrumbsType = {
linkLevel1: URL_PERSONAL_PROJECTS,
textLevel1: 'Personal Projects',
textLevel1: TEXT.personalProjects,
linkLevel2: PAGES_URL.personal.cryptoMania,
textLevel2: 'Cryptomania',
textLevel2: TEXT.cryptoMania,
}

const ProjectPersonalCryptomania = () => {
Expand All @@ -52,10 +52,9 @@ const ProjectPersonalCryptomania = () => {
imageShowcase={imageShowcase}
PageNavigation={
<PageNavigation
linkPrevious="/personal-projects/krsiak"
namePrevious="Portfolio Website"
linkPrevious={PAGES_URL.personal.krsiak}
namePrevious={TEXT.portfolioWebsite}
dataTestIdPrevious={DATA_TEST_IDS.projects.personal.cryptoMania.previous}
nameNext="E-Commerce Website"
/>
}
/>
Expand Down
12 changes: 6 additions & 6 deletions app/personal-projects/krsiak/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export const metadata: Metadata = {

const breadCrumbs: BreadCrumbsType = {
linkLevel1: URL_PERSONAL_PROJECTS,
textLevel1: 'Personal Projects',
textLevel1: TEXT.personalProjects,
linkLevel2: PAGES_URL.personal.krsiak,
textLevel2: 'Portfolio Website',
textLevel2: TEXT.portfolioWebsite,
}

const ProjectPersonalKrsiak = () => {
Expand All @@ -55,11 +55,11 @@ const ProjectPersonalKrsiak = () => {
imageShowcase={imageShowcase}
PageNavigation={
<PageNavigation
linkPrevious="/personal-projects"
namePrevious="Personal Projects"
linkPrevious={PAGES_URL.personal.mainUrl}
namePrevious={TEXT.personalProjects}
dataTestIdPrevious={DATA_TEST_IDS.projects.personal.krsiak.previous}
linkNext="/personal-projects/cryptomania"
nameNext="CryptoMania"
linkNext={PAGES_URL.personal.cryptoMania}
nameNext={TEXT.cryptoMania}
dataTestIdNext={DATA_TEST_IDS.projects.personal.krsiak.next}
/>
}
Expand Down
10 changes: 5 additions & 5 deletions app/personal-projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ export const metadata: Metadata = {
const ProjectsPersonal = () => {
return (
<PageContainer id={ID.projects.personal}>
<BreadCrumbs linkLevel1={PAGES_URL.personal.mainUrl} textLevel1="Personal Projects" />
<BreadCrumbs linkLevel1={PAGES_URL.personal.mainUrl} textLevel1={TEXT.personalProjects} />
<ProjectsLayout
heading="🚀 Personal Projects"
description="I like to learn new technologies and create personal projects where I can apply what I know and keep up on the latest trends."
>
<ProjectSection sectionId={ID.section.next} sectionText="Next" projectData={projectsPersonalNext} />
<ProjectSection sectionId={ID.section.react} sectionText="React" projectData={projectsPersonalReact} />
<ProjectSection sectionId={ID.section.next} sectionText={TEXT.next} projectData={projectsPersonalNext} />
<ProjectSection sectionId={ID.section.react} sectionText={TEXT.react} projectData={projectsPersonalReact} />
</ProjectsLayout>
<div className="mt-20">
<PageNavigation
linkPrevious="/work-experience"
namePrevious="Work Experience"
linkPrevious={PAGES_URL.work.mainUrl}
namePrevious={TEXT.workExperience}
dataTestIdPrevious={DATA_TEST_IDS.projects.personal.overview.previous}
/>
</div>
Expand Down
10 changes: 5 additions & 5 deletions app/resume/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const ResumePreviewEmbed = () => {
const Resume = () => {
return (
<PageContainer id={ID.about}>
<BreadCrumbs linkLevel1={PAGES_URL.aboutMe} textLevel1="About Me" />
<BreadCrumbs linkLevel1={PAGES_URL.aboutMe} textLevel1={TEXT.resume} />
<div>
<ResumeInfo />
<div className="mt-8">
Expand All @@ -73,11 +73,11 @@ const Resume = () => {
<ResumePreviewEmbed />
</div>
<PageNavigation
linkPrevious="/about-me"
namePrevious="About Me"
linkPrevious={PAGES_URL.aboutMe}
namePrevious={TEXT.aboutMe}
dataTestIdPrevious={DATA_TEST_IDS.page.resume.previous}
linkNext="/work-experience"
nameNext="Work Experience"
linkNext={PAGES_URL.work.mainUrl}
nameNext={TEXT.workExperience}
dataTestIdNext={DATA_TEST_IDS.page.resume.next}
/>
</PageContainer>
Expand Down
12 changes: 6 additions & 6 deletions app/work-experience/groupon/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const metadata: Metadata = {

const breadCrumbs: BreadCrumbsType = {
linkLevel1: URL_WORK_EXPERIENCE,
textLevel1: 'Work Experience',
textLevel1: TEXT.workExperience,
linkLevel2: PAGES_URL.work.groupon,
textLevel2: 'Groupon',
textLevel2: TEXT.groupon,
}

const ProjectWorkGroupon = () => {
Expand All @@ -51,11 +51,11 @@ const ProjectWorkGroupon = () => {
sections={sections}
PageNavigation={
<PageNavigation
linkPrevious="/work-experience/smartsupp-help"
namePrevious="Smartsupp HELP"
linkPrevious={PAGES_URL.work.smartsupp.help}
namePrevious={TEXT.smartsuppHELP}
dataTestIdPrevious={DATA_TEST_IDS.projects.work.groupon.previous}
linkNext="/work-experience/moravia"
nameNext="Moravia IT"
linkNext={PAGES_URL.work.moravia}
nameNext={TEXT.moravia}
dataTestIdNext={DATA_TEST_IDS.projects.work.groupon.next}
/>
}
Expand Down
12 changes: 6 additions & 6 deletions app/work-experience/komercni-banka/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const metadata: Metadata = {

const breadCrumbs: BreadCrumbsType = {
linkLevel1: URL_WORK_EXPERIENCE,
textLevel1: 'Work Experience',
textLevel1: TEXT.workExperience,
linkLevel2: PAGES_URL.work.komercniBanka,
textLevel2: 'Komerční banka',
textLevel2: TEXT.komercniBanka,
}

const ProjectWorkKomercniBanka = () => {
Expand All @@ -42,11 +42,11 @@ const ProjectWorkKomercniBanka = () => {
sections={sections}
PageNavigation={
<PageNavigation
linkPrevious="/work-experience/smartsupp-dashboard"
namePrevious="Smartsupp Dashboard"
linkPrevious={PAGES_URL.work.smartsupp.dashboard}
namePrevious={TEXT.smartsuppDashboard}
dataTestIdPrevious={DATA_TEST_IDS.projects.work.komercniBanka.previous}
linkNext="/work-experience/kooperativa"
nameNext="Kooperativa"
linkNext={PAGES_URL.work.kooperativa}
nameNext={TEXT.kooperativa}
dataTestIdNext={DATA_TEST_IDS.projects.work.komercniBanka.next}
/>
}
Expand Down
12 changes: 6 additions & 6 deletions app/work-experience/kooperativa/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export const metadata: Metadata = {

const breadCrumbs: BreadCrumbsType = {
linkLevel1: URL_WORK_EXPERIENCE,
textLevel1: 'Work Experience',
textLevel1: TEXT.workExperience,
linkLevel2: PAGES_URL.work.kooperativa,
textLevel2: 'Kooperativa',
textLevel2: TEXT.kooperativa,
}

const ProjectWorkKooperativa = () => {
Expand All @@ -45,11 +45,11 @@ const ProjectWorkKooperativa = () => {
sections={sections}
PageNavigation={
<PageNavigation
linkPrevious="/work-experience/komercni-banka"
namePrevious="Komerční banka"
linkPrevious={PAGES_URL.work.komercniBanka}
namePrevious={TEXT.komercniBanka}
dataTestIdPrevious={DATA_TEST_IDS.projects.work.kooperativa.previous}
linkNext="/work-experience/smartsupp-web"
nameNext="Smartsupp Web"
linkNext={PAGES_URL.work.smartsupp.web}
nameNext={TEXT.smartsuppWeb}
dataTestIdNext={DATA_TEST_IDS.projects.work.kooperativa.next}
/>
}
Expand Down
8 changes: 4 additions & 4 deletions app/work-experience/moravia/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export const metadata: Metadata = {

const breadCrumbs: BreadCrumbsType = {
linkLevel1: URL_WORK_EXPERIENCE,
textLevel1: 'Work Experience',
textLevel1: TEXT.workExperience,
linkLevel2: PAGES_URL.work.moravia,
textLevel2: 'Moravia',
textLevel2: TEXT.moravia,
}

const ProjectWorkMoravia = () => {
Expand All @@ -46,8 +46,8 @@ const ProjectWorkMoravia = () => {
sections={sections}
PageNavigation={
<PageNavigation
linkPrevious="/work-experience/groupon"
namePrevious="Groupon"
linkPrevious={PAGES_URL.work.groupon}
namePrevious={TEXT.groupon}
dataTestIdPrevious={DATA_TEST_IDS.projects.work.moravia.previous}
/>
}
Expand Down
10 changes: 5 additions & 5 deletions app/work-experience/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const metadata: Metadata = {
const ProjectsWork = () => {
return (
<PageContainer id={ID.projects.work}>
<BreadCrumbs linkLevel1={PAGES_URL.work.mainUrl} textLevel1="Work Experience" />
<BreadCrumbs linkLevel1={PAGES_URL.work.mainUrl} textLevel1={TEXT.workExperience} />
<ProjectsLayout
heading="🖥️ Work Experience"
description="I worked on modern products, developed new features, redesigned websites, implemented responsive design, updated legacy codebase, was responsible for localization, QA automation and testing, including work as team leader."
Expand Down Expand Up @@ -102,11 +102,11 @@ const ProjectsWork = () => {
</ProjectsLayout>
<div className="mt-20">
<PageNavigation
linkPrevious="/resume"
namePrevious="Resume"
linkPrevious={PAGES_URL.resume}
namePrevious={TEXT.resume}
dataTestIdPrevious={DATA_TEST_IDS.projects.work.overview.previous}
linkNext="/personal-projects"
nameNext="Personal Projects"
linkNext={PAGES_URL.personal.mainUrl}
nameNext={TEXT.personalProjects}
dataTestIdNext={DATA_TEST_IDS.projects.work.overview.next}
/>
</div>
Expand Down
12 changes: 6 additions & 6 deletions app/work-experience/smartsupp-dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export const metadata: Metadata = {

const breadCrumbs: BreadCrumbsType = {
linkLevel1: URL_WORK_EXPERIENCE,
textLevel1: 'Work Experience',
textLevel1: TEXT.workExperience,
linkLevel2: PAGES_URL.work.smartsupp.dashboard,
textLevel2: 'Smartsupp Dashboard',
textLevel2: TEXT.smartsuppDashboard,
}

const ProjectWorkSmartsuppDashboard = () => {
Expand All @@ -46,11 +46,11 @@ const ProjectWorkSmartsuppDashboard = () => {
sections={sections}
PageNavigation={
<PageNavigation
linkPrevious="/work-experience"
namePrevious="Work Experience"
linkPrevious={PAGES_URL.work.mainUrl}
namePrevious={TEXT.workExperience}
dataTestIdPrevious={DATA_TEST_IDS.projects.work.smartsupp.dashboard.previous}
linkNext="/work-experience/komercni-banka"
nameNext="Komerční banka"
linkNext={PAGES_URL.work.komercniBanka}
nameNext={TEXT.komercniBanka}
dataTestIdNext={DATA_TEST_IDS.projects.work.smartsupp.dashboard.next}
/>
}
Expand Down
12 changes: 6 additions & 6 deletions app/work-experience/smartsupp-help/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export const metadata: Metadata = {

const breadCrumbs: BreadCrumbsType = {
linkLevel1: URL_WORK_EXPERIENCE,
textLevel1: 'Work Experience',
textLevel1: TEXT.workExperience,
linkLevel2: PAGES_URL.work.smartsupp.help,
textLevel2: 'Smartsupp Help',
textLevel2: TEXT.smartsuppHELP,
}

const ProjectWorkSmartsuppHelp = () => {
Expand All @@ -41,11 +41,11 @@ const ProjectWorkSmartsuppHelp = () => {
sections={sections}
PageNavigation={
<PageNavigation
linkPrevious="/work-experience/smartsupp-web"
namePrevious="Smartsupp Web"
linkPrevious={PAGES_URL.work.smartsupp.web}
namePrevious={TEXT.smartsuppWeb}
dataTestIdPrevious={DATA_TEST_IDS.projects.work.smartsupp.help.previous}
linkNext="/work-experience/groupon"
nameNext="Groupon"
linkNext={PAGES_URL.work.groupon}
nameNext={TEXT.groupon}
dataTestIdNext={DATA_TEST_IDS.projects.work.smartsupp.help.next}
/>
}
Expand Down
12 changes: 6 additions & 6 deletions app/work-experience/smartsupp-web/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export const metadata: Metadata = {

const breadCrumbs: BreadCrumbsType = {
linkLevel1: URL_WORK_EXPERIENCE,
textLevel1: 'Work Experience',
textLevel1: TEXT.workExperience,
linkLevel2: PAGES_URL.work.smartsupp.web,
textLevel2: 'Smartsupp Web',
textLevel2: TEXT.smartsuppWeb,
}

const ProjectWorkSmartsuppWeb = () => {
Expand All @@ -44,11 +44,11 @@ const ProjectWorkSmartsuppWeb = () => {
sections={sections}
PageNavigation={
<PageNavigation
linkPrevious="/work-experience/kooperativa"
namePrevious="Kooperativa"
linkPrevious={PAGES_URL.work.kooperativa}
namePrevious={TEXT.kooperativa}
dataTestIdPrevious={DATA_TEST_IDS.projects.work.smartsupp.web.previous}
linkNext="/work-experience/smartsupp-help"
nameNext="Smartsupp HELP"
linkNext={PAGES_URL.work.smartsupp.help}
nameNext={TEXT.smartsuppHELP}
dataTestIdNext={DATA_TEST_IDS.projects.work.smartsupp.web.next}
/>
}
Expand Down
Loading

0 comments on commit 1b41651

Please sign in to comment.