From effb9126412607ae5c60c4041d1d9ad893f37e60 Mon Sep 17 00:00:00 2001 From: Timothy Armes Date: Tue, 10 Oct 2023 19:48:13 +0200 Subject: [PATCH] Update next-intl (and other packages), internationalize URLs --- .eslintrc.json | 7 +- .vscode/settings.json | 2 + .../Map.tsx | 0 .../TournamentForm.tsx | 0 .../page.tsx | 0 app/[locale]/components/Footer.tsx | 20 +- app/[locale]/components/HamburgerMenu.tsx | 4 +- app/[locale]/components/Navbar.tsx | 7 +- .../ContactForm.tsx | 0 .../{contactez-nous => contact-us}/page.tsx | 0 app/[locale]/elo/page.tsx | 15 +- app/[locale]/layout.tsx | 3 +- app/[locale]/page.tsx | 8 +- .../{tournois => tournaments}/Legend.tsx | 0 .../TimeControlFilters.tsx | 0 .../TournamentMap.tsx | 0 .../TournamentMarker.tsx | 0 .../TournamentTable.tsx | 0 .../TournamentsDisplay.tsx | 0 .../{tournois => tournaments}/page.tsx | 0 app/{[locale] => }/providers/TrpcProvider.tsx | 0 app/{[locale] => }/providers/index.tsx | 0 app/sitemap.ts | 41 +- .../components/DatePickerCustomHeader.tsx | 1 - .../DateField/components/InputDatePicker.tsx | 12 +- components/form/DateField/index.tsx | 5 +- components/form/Field.tsx | 3 - middleware.ts | 12 +- package.json | 13 +- tailwind.config.js | 1 + utils/navigation.ts | 32 + yarn.lock | 1655 ++++++++--------- 32 files changed, 902 insertions(+), 939 deletions(-) rename app/[locale]/{ajouter-un-tournoi => add-tournament}/Map.tsx (100%) rename app/[locale]/{ajouter-un-tournoi => add-tournament}/TournamentForm.tsx (100%) rename app/[locale]/{ajouter-un-tournoi => add-tournament}/page.tsx (100%) rename app/[locale]/{contactez-nous => contact-us}/ContactForm.tsx (100%) rename app/[locale]/{contactez-nous => contact-us}/page.tsx (100%) rename app/[locale]/{tournois => tournaments}/Legend.tsx (100%) rename app/[locale]/{tournois => tournaments}/TimeControlFilters.tsx (100%) rename app/[locale]/{tournois => tournaments}/TournamentMap.tsx (100%) rename app/[locale]/{tournois => tournaments}/TournamentMarker.tsx (100%) rename app/[locale]/{tournois => tournaments}/TournamentTable.tsx (100%) rename app/[locale]/{tournois => tournaments}/TournamentsDisplay.tsx (100%) rename app/[locale]/{tournois => tournaments}/page.tsx (100%) rename app/{[locale] => }/providers/TrpcProvider.tsx (100%) rename app/{[locale] => }/providers/index.tsx (100%) create mode 100644 utils/navigation.ts diff --git a/.eslintrc.json b/.eslintrc.json index de59fbb..ed3d667 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,10 +1,5 @@ { - "extends": [ - "next", - "next/core-web-vitals", - "plugin:react-hooks/recommended", - "prettier" - ], + "extends": ["next", "next/core-web-vitals", "prettier"], "globals": { "React": "readonly" } diff --git a/.vscode/settings.json b/.vscode/settings.json index c2a5091..c1f6fdf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "cSpell.words": [ + "ajouter", "approximative", "Armes", "colour", @@ -30,6 +31,7 @@ "tailwindcss", "tanstack", "timothyarmes", + "tournoi", "tournois", "trivago", "TRPC", diff --git a/app/[locale]/ajouter-un-tournoi/Map.tsx b/app/[locale]/add-tournament/Map.tsx similarity index 100% rename from app/[locale]/ajouter-un-tournoi/Map.tsx rename to app/[locale]/add-tournament/Map.tsx diff --git a/app/[locale]/ajouter-un-tournoi/TournamentForm.tsx b/app/[locale]/add-tournament/TournamentForm.tsx similarity index 100% rename from app/[locale]/ajouter-un-tournoi/TournamentForm.tsx rename to app/[locale]/add-tournament/TournamentForm.tsx diff --git a/app/[locale]/ajouter-un-tournoi/page.tsx b/app/[locale]/add-tournament/page.tsx similarity index 100% rename from app/[locale]/ajouter-un-tournoi/page.tsx rename to app/[locale]/add-tournament/page.tsx diff --git a/app/[locale]/components/Footer.tsx b/app/[locale]/components/Footer.tsx index 7787e04..ea1ed96 100644 --- a/app/[locale]/components/Footer.tsx +++ b/app/[locale]/components/Footer.tsx @@ -1,11 +1,15 @@ +"use client"; + import { useTranslations } from "next-intl"; -import Link from "next-intl/link"; import { FaGithub, FaRegEnvelope } from "react-icons/fa"; +import { Link, usePathname } from "@/utils/navigation"; + import ThemeSwitcher from "./ThemeSwitcher"; export default function Footer() { const t = useTranslations("Footer"); + const pathname = usePathname(); return (