From 0c02dcdad0cfc98e9295cd259d2ef8a7301b8cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Loureiro?= Date: Fri, 29 Aug 2025 01:50:21 -0300 Subject: [PATCH] feat: update language switcher order, enhance project card links, and localize new page link --- .../src/app/components/LanguageSwitcher.tsx | 4 ++-- frontend/src/app/components/ProjectCard.tsx | 22 +++++++++++-------- frontend/src/app/page.tsx | 2 +- frontend/src/locales/en.json | 1 + frontend/src/locales/pt.json | 1 + 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/components/LanguageSwitcher.tsx b/frontend/src/app/components/LanguageSwitcher.tsx index 06f704e..5d9514e 100644 --- a/frontend/src/app/components/LanguageSwitcher.tsx +++ b/frontend/src/app/components/LanguageSwitcher.tsx @@ -34,8 +34,8 @@ export default function LanguageSwitcher() { }, []); const languages: { [key: string]: { label: string; countryCode: string } } = { - en: { label: 'English', countryCode: 'US' }, - pt: { label: 'Português', countryCode: 'BR' }, + pt: { label: 'Português', countryCode: 'BR' }, + en: { label: 'English', countryCode: 'US' } }; return ( diff --git a/frontend/src/app/components/ProjectCard.tsx b/frontend/src/app/components/ProjectCard.tsx index 5b6fdf6..6ee7438 100644 --- a/frontend/src/app/components/ProjectCard.tsx +++ b/frontend/src/app/components/ProjectCard.tsx @@ -1,6 +1,6 @@ import Link from 'next/link'; import {useTranslations, useLocale} from 'next-intl'; -import { FaGithub, FaArrowUpRightFromSquare } from 'react-icons/fa6'; +import { FaGithub, FaArrowUpRightFromSquare, FaLink } from 'react-icons/fa6'; import Image from 'next/image'; type ProjectCardProps = { @@ -18,7 +18,7 @@ export default function ProjectCard({ title, description, tech, imageUrl, liveUr const locale = useLocale(); return ( - +
{title}
@@ -33,20 +33,24 @@ export default function ProjectCard({ title, description, tech, imageUrl, liveUr ))}
- {liveUrl && ( - - {t('live_link')} - - - )} + + + {t('page_link')} + {repoUrl && ( {t('repo_link')} )} + {liveUrl && ( + + {t('live_link')} + + + )}
- + ); } \ No newline at end of file diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index ff1861d..f58465c 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -1,5 +1,5 @@ import {redirect} from 'next/navigation'; export default function RootPage() { - redirect('/en'); + redirect('/pt'); } \ No newline at end of file diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index e2e2212..981d771 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -45,6 +45,7 @@ "project_3_title": "Happy", "project_3_description": "A site to find orphanages to visit. Built with React, TypeScript and Styled-Components.", "tech_used": "Technologies Used:", + "page_link": "See Details", "live_link": "Live Demo", "repo_link": "View Code", "back_to_projects": "Back to Projects", diff --git a/frontend/src/locales/pt.json b/frontend/src/locales/pt.json index 96ac197..2c9992f 100644 --- a/frontend/src/locales/pt.json +++ b/frontend/src/locales/pt.json @@ -45,6 +45,7 @@ "project_3_title": "Happy", "project_3_description": "Um site para encontrar orfanatos para visitar. Construído com React, TypeScript e Styled-Components.", "tech_used": "Tecnologias Utilizadas:", + "page_link": "Ver Detalhes", "live_link": "Ver ao Vivo", "repo_link": "Ver Código", "back_to_projects": "Voltar para Projetos",