diff --git a/app/[locale]/10years/page.tsx b/app/[locale]/10years/page.tsx index c151534fee7..f9268498e7e 100644 --- a/app/[locale]/10years/page.tsx +++ b/app/[locale]/10years/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import Emoji from "@/components/Emoji" import I18nProvider from "@/components/I18nProvider" @@ -66,8 +66,8 @@ const loadData = dataLoader( const zIndexClasses = ["z-50", "z-40", "z-30", "z-20", "z-10", "z-0"] -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -437,9 +437,9 @@ export async function generateStaticParams() { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/[...slug]/page.tsx b/app/[locale]/[...slug]/page.tsx index 2a3d343540d..b731f3f7c87 100644 --- a/app/[locale]/[...slug]/page.tsx +++ b/app/[locale]/[...slug]/page.tsx @@ -6,7 +6,7 @@ import { setRequestLocale, } from "next-intl/server" -import { SlugPageParams } from "@/lib/types" +import type { SlugPageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" import mdComponents from "@/components/MdComponents" @@ -28,16 +28,12 @@ import { getMdMetadata } from "@/lib/md/metadata" const loadData = dataLoader([["gfissues", fetchGFIs]]) -export default async function Page({ - params, -}: { - params: Promise -}) { - const { locale, slug: slugArray } = await params +export default async function Page({ params }: { params: SlugPageParams }) { + const { locale, slug: slugArray } = params // Check if this specific path is in our valid paths - const validPaths = await generateStaticParams() - const isValidPath = checkPathValidity(validPaths, await params) + const validPaths = (await generateStaticParams()) as SlugPageParams[] + const isValidPath = checkPathValidity(validPaths, params) if (!isValidPath) notFound() @@ -128,12 +124,8 @@ export async function generateStaticParams() { } } -export async function generateMetadata({ - params, -}: { - params: Promise -}) { - const { locale, slug } = await params +export async function generateMetadata({ params }: { params: SlugPageParams }) { + const { locale, slug } = params try { return await getMdMetadata({ diff --git a/app/[locale]/apps/[application]/page.tsx b/app/[locale]/apps/[application]/page.tsx index 365f519ef24..07b79cb6ea9 100644 --- a/app/[locale]/apps/[application]/page.tsx +++ b/app/[locale]/apps/[application]/page.tsx @@ -6,7 +6,7 @@ import { setRequestLocale, } from "next-intl/server" -import { ChainName, CommitHistory, Lang } from "@/lib/types" +import type { ChainName, CommitHistory, Lang, PageParams } from "@/lib/types" import ChainImages from "@/components/ChainImages" import { ChevronNext } from "@/components/Chevron" @@ -59,9 +59,9 @@ const loadData = dataLoader([["appsData", fetchApps]], REVALIDATE_TIME * 1000) const Page = async ({ params, }: { - params: { locale: string; application: string } + params: PageParams & { application: string } }) => { - const { locale, application } = await params + const { locale, application } = params setRequestLocale(locale) // Get translations @@ -387,9 +387,9 @@ const Page = async ({ export async function generateMetadata({ params, }: { - params: Promise<{ locale: string; application: string }> + params: { locale: string; application: string } }) { - const { locale, application } = await params + const { locale, application } = params const [appsData] = await loadData() diff --git a/app/[locale]/apps/categories/[catetgoryName]/page.tsx b/app/[locale]/apps/categories/[catetgoryName]/page.tsx index f0fa8c7c5e0..01fea8251c9 100644 --- a/app/[locale]/apps/categories/[catetgoryName]/page.tsx +++ b/app/[locale]/apps/categories/[catetgoryName]/page.tsx @@ -8,8 +8,9 @@ import { import { AppCategoryEnum, - CommitHistory, - Lang, + type CommitHistory, + type Lang, + type PageParams, type SectionNavDetails, } from "@/lib/types" @@ -57,9 +58,9 @@ const loadData = dataLoader([["appsData", fetchApps]], REVALIDATE_TIME * 1000) const Page = async ({ params, }: { - params: { locale: string; catetgoryName: string } + params: PageParams & { catetgoryName: string } }) => { - const { locale, catetgoryName } = await params + const { locale, catetgoryName } = params setRequestLocale(locale) const [appsData] = await loadData() @@ -181,9 +182,9 @@ const Page = async ({ export async function generateMetadata({ params, }: { - params: Promise<{ locale: string; catetgoryName: string }> + params: { locale: string; catetgoryName: string } }) { - const { locale, catetgoryName } = await params + const { locale, catetgoryName } = params const t = await getTranslations({ locale, namespace: "page-apps" }) // Normalize slug to lowercase diff --git a/app/[locale]/apps/page.tsx b/app/[locale]/apps/page.tsx index 489effbba18..fead496ef10 100644 --- a/app/[locale]/apps/page.tsx +++ b/app/[locale]/apps/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import Breadcrumbs from "@/components/Breadcrumbs" import { SimpleHero } from "@/components/Hero" @@ -44,8 +44,8 @@ const loadData = dataLoader( REVALIDATE_TIME * 1000 ) -const Page = async ({ params }: { params: { locale: string } }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -158,9 +158,9 @@ const Page = async ({ params }: { params: { locale: string } }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-apps" }) return await getMetadata({ diff --git a/app/[locale]/assets/page.tsx b/app/[locale]/assets/page.tsx index b3ae8895930..e37966ae161 100644 --- a/app/[locale]/assets/page.tsx +++ b/app/[locale]/assets/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,12 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import AssetsPage from "./_components/assets" import AssetsJsonLD from "./page-jsonld" -export default async function Page({ - params, -}: { - params: Promise<{ locale: Lang }> -}) { - const { locale } = await params +export default async function Page({ params }: { params: PageParams }) { + const { locale } = params setRequestLocale(locale) @@ -50,9 +46,9 @@ export default async function Page({ export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-assets" }) diff --git a/app/[locale]/bug-bounty/page.tsx b/app/[locale]/bug-bounty/page.tsx index a3b85bf8d4b..042a6b3e54f 100644 --- a/app/[locale]/bug-bounty/page.tsx +++ b/app/[locale]/bug-bounty/page.tsx @@ -798,9 +798,9 @@ export default async function Page({ params }: { params: Promise }) { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-bug-bounty" }) diff --git a/app/[locale]/collectibles/page.tsx b/app/[locale]/collectibles/page.tsx index d898bd7b87b..0957f1f31d8 100644 --- a/app/[locale]/collectibles/page.tsx +++ b/app/[locale]/collectibles/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import { HubHero } from "@/components/Hero" import I18nProvider from "@/components/I18nProvider" @@ -40,12 +40,8 @@ async function fetchStats() { return res.json() } -export default async function Page({ - params, -}: { - params: Promise<{ locale: Lang }> -}) { - const { locale } = await params +export default async function Page({ params }: { params: PageParams }) { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-collectibles" }) setRequestLocale(locale) @@ -155,9 +151,9 @@ export default async function Page({ export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-collectibles" }) return await getMetadata({ locale, diff --git a/app/[locale]/community/page.tsx b/app/[locale]/community/page.tsx index 803e845e139..87d942f33f8 100644 --- a/app/[locale]/community/page.tsx +++ b/app/[locale]/community/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,7 +16,7 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import CommunityPage from "./_components/community" import CommunityJsonLD from "./page-jsonld" -export default async function Page({ params }: { params: { locale: Lang } }) { +export default async function Page({ params }: { params: PageParams }) { const { locale } = params setRequestLocale(locale) diff --git a/app/[locale]/contributing/translation-program/acknowledgements/page.tsx b/app/[locale]/contributing/translation-program/acknowledgements/page.tsx index b174b61c43c..abd537d06c0 100644 --- a/app/[locale]/contributing/translation-program/acknowledgements/page.tsx +++ b/app/[locale]/contributing/translation-program/acknowledgements/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,8 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import Acknowledgements from "./_components/acknowledgements" import AcknowledgementsJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -48,9 +48,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/contributing/translation-program/contributors/page.tsx b/app/[locale]/contributing/translation-program/contributors/page.tsx index 30e5fd90dbd..eea58f1515c 100644 --- a/app/[locale]/contributing/translation-program/contributors/page.tsx +++ b/app/[locale]/contributing/translation-program/contributors/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,8 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import Contributors from "./_components/contributors" import ContributorsJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -48,9 +48,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/contributing/translation-program/translatathon/leaderboard/page.tsx b/app/[locale]/contributing/translation-program/translatathon/leaderboard/page.tsx index 4d558a7bc91..0c59ce6c02d 100644 --- a/app/[locale]/contributing/translation-program/translatathon/leaderboard/page.tsx +++ b/app/[locale]/contributing/translation-program/translatathon/leaderboard/page.tsx @@ -1,6 +1,6 @@ import { setRequestLocale } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang } from "@/lib/types" import { List as ButtonDropdownList } from "@/components/ButtonDropdown" import ContentHero, { ContentHeroProps } from "@/components/Hero/ContentHero" @@ -158,9 +158,9 @@ const Page = async ({ params }: { params: Promise<{ locale: string }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params return await getMetadata({ locale, diff --git a/app/[locale]/developers/learning-tools/page.tsx b/app/[locale]/developers/learning-tools/page.tsx index 13bfaf0ee03..49c6e6a2059 100644 --- a/app/[locale]/developers/learning-tools/page.tsx +++ b/app/[locale]/developers/learning-tools/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,8 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import LearningTools from "./_components/learning-tools" import LearningToolsJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -49,9 +49,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/developers/local-environment/page.tsx b/app/[locale]/developers/local-environment/page.tsx index 46e129f0ccd..c8cf206e3e0 100644 --- a/app/[locale]/developers/local-environment/page.tsx +++ b/app/[locale]/developers/local-environment/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -23,8 +23,8 @@ const loadData = dataLoader([ ["frameworksListData", getLocalEnvironmentFrameworkData], ]) -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -62,9 +62,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/developers/page.tsx b/app/[locale]/developers/page.tsx index 4a57aa2ad5d..8c4eb25f030 100644 --- a/app/[locale]/developers/page.tsx +++ b/app/[locale]/developers/page.tsx @@ -1,6 +1,6 @@ import { getTranslations } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import { ChildOnlyProp } from "@/lib/types" import BigNumber from "@/components/BigNumber" @@ -109,12 +109,8 @@ const WhyGrid = () => { ) } -const DevelopersPage = async ({ - params, -}: { - params: Promise<{ locale: Lang }> -}) => { - const { locale } = await params +const DevelopersPage = async ({ params }: { params: PageParams }) => { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-developers-index", @@ -608,9 +604,9 @@ const DevelopersPage = async ({ export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/developers/tutorials/page.tsx b/app/[locale]/developers/tutorials/page.tsx index 5d4a047a39a..94ebf11615c 100644 --- a/app/[locale]/developers/tutorials/page.tsx +++ b/app/[locale]/developers/tutorials/page.tsx @@ -6,7 +6,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import FeedbackCard from "@/components/FeedbackCard" import I18nProvider from "@/components/I18nProvider" @@ -46,8 +46,8 @@ const TutorialSubmitModal = dynamic(() => import("./_components/modal"), { ), }) -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -108,9 +108,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/enterprise/page.tsx b/app/[locale]/enterprise/page.tsx index fb02dac1a25..9e713aa3c85 100644 --- a/app/[locale]/enterprise/page.tsx +++ b/app/[locale]/enterprise/page.tsx @@ -2,7 +2,12 @@ import { Check } from "lucide-react" import dynamic from "next/dynamic" import { getTranslations } from "next-intl/server" -import type { CommitHistory, Lang, StatsBoxMetric } from "@/lib/types" +import type { + CommitHistory, + Lang, + PageParams, + StatsBoxMetric, +} from "@/lib/types" import ActivityStats from "@/components/ActivityStats" import { HubHero } from "@/components/Hero" @@ -102,7 +107,7 @@ const loadData = dataLoader( BASE_TIME_UNIT * 1000 ) -const Page = async ({ params }: { params: { locale: Lang } }) => { +const Page = async ({ params }: { params: PageParams }) => { const { locale } = params const t = await getTranslations({ locale, namespace: "page-enterprise" }) @@ -568,9 +573,9 @@ const Page = async ({ params }: { params: { locale: Lang } }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-enterprise" }) return await getMetadata({ locale, diff --git a/app/[locale]/eth/page.tsx b/app/[locale]/eth/page.tsx index 13aba01b9aa..0b110e56e66 100644 --- a/app/[locale]/eth/page.tsx +++ b/app/[locale]/eth/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,12 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import EthPage from "./_components/eth" import EthPageJsonLD from "./page-jsonld" -export default async function Page({ - params, -}: { - params: Promise<{ locale: Lang }> -}) { - const { locale } = await params +export default async function Page({ params }: { params: PageParams }) { + const { locale } = params setRequestLocale(locale) @@ -56,9 +52,9 @@ export default async function Page({ export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-eth" }) diff --git a/app/[locale]/founders/page.tsx b/app/[locale]/founders/page.tsx index 25e1f441d3c..bda1d56dae7 100644 --- a/app/[locale]/founders/page.tsx +++ b/app/[locale]/founders/page.tsx @@ -2,7 +2,12 @@ import React from "react" import { Banknote, ChartNoAxesCombined, Handshake } from "lucide-react" import { getTranslations } from "next-intl/server" -import type { CommitHistory, Lang, SectionNavDetails } from "@/lib/types" +import type { + CommitHistory, + Lang, + PageParams, + SectionNavDetails, +} from "@/lib/types" import CommentCard from "@/components/CommentCard" import ContentHero from "@/components/Hero/ContentHero" @@ -38,8 +43,8 @@ import heroImg from "@/public/images/upgrades/merge.png" const GetInTouchId = "get-in-touch" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-founders" }) const supportTags = { @@ -545,9 +550,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/gas/page.tsx b/app/[locale]/gas/page.tsx index 94580de99de..4caca134ded 100644 --- a/app/[locale]/gas/page.tsx +++ b/app/[locale]/gas/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,8 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import GasPage from "./_components/gas" import GasPageJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -49,9 +49,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-gas" }) diff --git a/app/[locale]/get-eth/page.tsx b/app/[locale]/get-eth/page.tsx index 54cff19bc1e..b6f7ff50a82 100644 --- a/app/[locale]/get-eth/page.tsx +++ b/app/[locale]/get-eth/page.tsx @@ -7,8 +7,12 @@ import { } from "next-intl/server" import type { ReactNode } from "react" -import type { ChildOnlyProp } from "@/lib/types" -import type { CommitHistory, Lang } from "@/lib/types" +import type { + ChildOnlyProp, + CommitHistory, + Lang, + PageParams, +} from "@/lib/types" import CalloutBanner from "@/components/CalloutBanner" import CardList, { @@ -95,12 +99,8 @@ const TwoColumnContent = (props: ChildOnlyProp) => (
) -export default async function Page({ - params, -}: { - params: Promise<{ locale: Lang }> -}) { - const { locale } = await params +export default async function Page({ params }: { params: PageParams }) { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-get-eth" }) const tCommon = await getTranslations({ locale, namespace: "common" }) @@ -433,9 +433,9 @@ export async function generateStaticParams() { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-get-eth" }) diff --git a/app/[locale]/layer-2/learn/page.tsx b/app/[locale]/layer-2/learn/page.tsx index 111969bd053..da8820dd8b2 100644 --- a/app/[locale]/layer-2/learn/page.tsx +++ b/app/[locale]/layer-2/learn/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,8 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import LearnPage from "./_components/learn" import Layer2LearnPageJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -53,9 +53,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-layer-2-learn" }) diff --git a/app/[locale]/layer-2/networks/page.tsx b/app/[locale]/layer-2/networks/page.tsx index b8a08d4b99c..93ab1b96f0d 100644 --- a/app/[locale]/layer-2/networks/page.tsx +++ b/app/[locale]/layer-2/networks/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -43,8 +43,8 @@ const loadData = dataLoader( REVALIDATE_TIME * 1000 ) -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -142,9 +142,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/layer-2/page.tsx b/app/[locale]/layer-2/page.tsx index 5cf28d5d552..80b317c6f51 100644 --- a/app/[locale]/layer-2/page.tsx +++ b/app/[locale]/layer-2/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -37,8 +37,8 @@ const loadData = dataLoader( REVALIDATE_TIME * 1000 ) -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -98,9 +98,9 @@ export async function generateStaticParams() { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-layer-2" }) diff --git a/app/[locale]/learn/page.tsx b/app/[locale]/learn/page.tsx index 702b0b7e24b..f5f42ba1ca5 100644 --- a/app/[locale]/learn/page.tsx +++ b/app/[locale]/learn/page.tsx @@ -1,8 +1,8 @@ import { HTMLAttributes, ReactNode } from "react" import { getTranslations } from "next-intl/server" -import type { ChildOnlyProp, ToCItem } from "@/lib/types" -import type { CommitHistory, Lang, Params } from "@/lib/types" +import type { ChildOnlyProp, PageParams, ToCItem } from "@/lib/types" +import type { CommitHistory, Lang } from "@/lib/types" import OriginalCard, { type CardProps as OriginalCardProps, @@ -116,8 +116,8 @@ const ImageHeight200 = ({ src, alt }: ImageProps) => ( {alt} ) -export default async function Page({ params }: { params: Promise }) { - const { locale } = await params +export default async function Page({ params }: { params: PageParams }) { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-learn" }) const tCommon = await getTranslations({ locale, namespace: "common" }) @@ -737,9 +737,9 @@ export default async function Page({ params }: { params: Promise }) { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-learn" }) diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index e48ae1b97cf..ab8833d8eeb 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -6,9 +6,9 @@ import { getTranslations, setRequestLocale } from "next-intl/server" import type { AllHomepageActivityData, CommunityBlog, + PageParams, ValuesPairing, } from "@/lib/types" -import type { Lang } from "@/lib/types" import { CodeExample } from "@/lib/interfaces" import ABTestWrapper from "@/components/AB/TestWrapper" @@ -152,8 +152,8 @@ const loadData = dataLoader( REVALIDATE_TIME * 1000 ) -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params if (!LOCALES_CODES.includes(locale)) return notFound() @@ -1006,9 +1006,9 @@ export async function generateStaticParams() { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params try { const t = await getTranslations({ locale, namespace: "page-index" }) diff --git a/app/[locale]/quizzes/page.tsx b/app/[locale]/quizzes/page.tsx index cee67c69a28..62526a0fabe 100644 --- a/app/[locale]/quizzes/page.tsx +++ b/app/[locale]/quizzes/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,8 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import QuizzesPage from "./_components/quizzes" import QuizzesPageJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -44,9 +44,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale }) diff --git a/app/[locale]/resources/page.tsx b/app/[locale]/resources/page.tsx index de7f85facd3..2799aac7661 100644 --- a/app/[locale]/resources/page.tsx +++ b/app/[locale]/resources/page.tsx @@ -1,6 +1,6 @@ import { getTranslations } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import BannerNotification from "@/components/Banners/BannerNotification" import { HubHero } from "@/components/Hero" @@ -38,8 +38,8 @@ const loadData = dataLoader( REVALIDATE_TIME * 1000 ) -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-resources" }) @@ -216,9 +216,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-resources" }) diff --git a/app/[locale]/roadmap/page.tsx b/app/[locale]/roadmap/page.tsx index 6621b3c729a..0ee5c9fe479 100644 --- a/app/[locale]/roadmap/page.tsx +++ b/app/[locale]/roadmap/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,8 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import RoadmapPage from "./_components/roadmap" import RoadmapPageJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -44,9 +44,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-roadmap" }) diff --git a/app/[locale]/roadmap/vision/page.tsx b/app/[locale]/roadmap/vision/page.tsx index dfce76879f7..a9a59085544 100644 --- a/app/[locale]/roadmap/vision/page.tsx +++ b/app/[locale]/roadmap/vision/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,8 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import VisionPage from "./_components/vision" import RoadmapVisionPageJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -53,9 +53,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-roadmap-vision" }) diff --git a/app/[locale]/run-a-node/page.tsx b/app/[locale]/run-a-node/page.tsx index a94b497e2a8..1f78bc371d2 100644 --- a/app/[locale]/run-a-node/page.tsx +++ b/app/[locale]/run-a-node/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -16,8 +16,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import RunANodePage from "./_components/run-a-node" import RunANodePageJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -53,9 +53,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-run-a-node" }) diff --git a/app/[locale]/stablecoins/page.tsx b/app/[locale]/stablecoins/page.tsx index c847d878461..36dc030894e 100644 --- a/app/[locale]/stablecoins/page.tsx +++ b/app/[locale]/stablecoins/page.tsx @@ -6,7 +6,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import CalloutBannerSSR from "@/components/CalloutBannerSSR" import DataProductCard from "@/components/DataProductCard" @@ -93,8 +93,8 @@ const loadData = dataLoader<[CoinGeckoCoinMarketResponse]>( REVALIDATE_TIME * 1000 ) -async function Page({ params }: { params: Promise<{ locale: Lang }> }) { - const { locale } = await params +async function Page({ params }: { params: PageParams }) { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-stablecoins" }) const tCommon = await getTranslations({ locale, namespace: "common" }) @@ -775,9 +775,9 @@ async function Page({ params }: { params: Promise<{ locale: Lang }> }) { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-stablecoins" }) diff --git a/app/[locale]/staking/deposit-contract/page.tsx b/app/[locale]/staking/deposit-contract/page.tsx index 7d48a4af20f..ab9b47971eb 100644 --- a/app/[locale]/staking/deposit-contract/page.tsx +++ b/app/[locale]/staking/deposit-contract/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { Lang } from "@/lib/types" +import type { PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" @@ -14,8 +14,8 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations" import DepositContractPage from "./_components/deposit-contract" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -36,9 +36,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/staking/page.tsx b/app/[locale]/staking/page.tsx index 602411ae4c2..18ecf3ca3a7 100644 --- a/app/[locale]/staking/page.tsx +++ b/app/[locale]/staking/page.tsx @@ -10,6 +10,7 @@ import { EpochResponse, EthStoreResponse, Lang, + PageParams, StakingStatsData, } from "@/lib/types" @@ -62,8 +63,8 @@ const loadData = dataLoader( REVALIDATE_TIME * 1000 ) -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -102,9 +103,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-staking" }) diff --git a/app/[locale]/start/page.tsx b/app/[locale]/start/page.tsx index 70d9da71b1b..d8f90d68420 100644 --- a/app/[locale]/start/page.tsx +++ b/app/[locale]/start/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import I18nProvider from "@/components/I18nProvider" import { Image } from "@/components/Image" @@ -23,8 +23,8 @@ import StartPageJsonLD from "./page-jsonld" import HeroImage from "@/public/images/heroes/developers-hub-hero.png" import ManDogeImage from "@/public/images/start-with-ethereum/man-doge-playing.png" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-start" }) setRequestLocale(locale) @@ -94,9 +94,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-start" }) diff --git a/app/[locale]/trillion-dollar-security/page.tsx b/app/[locale]/trillion-dollar-security/page.tsx index 8cf7a977156..0aaa6816dd8 100644 --- a/app/[locale]/trillion-dollar-security/page.tsx +++ b/app/[locale]/trillion-dollar-security/page.tsx @@ -2,7 +2,7 @@ import React from "react" import Image from "next/image" import { getTranslations, setRequestLocale } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import MainArticle from "@/components/MainArticle" import { ButtonLink } from "@/components/ui/buttons/Button" @@ -43,8 +43,8 @@ const ReportCard = ({ cta, altText }: { cta: string; altText: string }) => { ) } -const TdsPage = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const TdsPage = async ({ params }: { params: PageParams }) => { + const { locale } = params setRequestLocale(locale) @@ -1094,9 +1094,9 @@ const TdsPage = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/wallets/find-wallet/page.tsx b/app/[locale]/wallets/find-wallet/page.tsx index a11dd7ec8be..e288ad80b87 100644 --- a/app/[locale]/wallets/find-wallet/page.tsx +++ b/app/[locale]/wallets/find-wallet/page.tsx @@ -5,7 +5,7 @@ import { setRequestLocale, } from "next-intl/server" -import { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import Breadcrumbs from "@/components/Breadcrumbs" import FindWalletProductTable from "@/components/FindWalletProductTable/lazy" @@ -23,8 +23,8 @@ import { import FindWalletPageJsonLD from "./page-jsonld" -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-wallets-find-wallet", @@ -89,9 +89,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, diff --git a/app/[locale]/wallets/page.tsx b/app/[locale]/wallets/page.tsx index bf5ff76fe70..88b34cec244 100644 --- a/app/[locale]/wallets/page.tsx +++ b/app/[locale]/wallets/page.tsx @@ -6,7 +6,7 @@ import { setRequestLocale, } from "next-intl/server" -import type { CommitHistory, Lang } from "@/lib/types" +import type { CommitHistory, Lang, PageParams } from "@/lib/types" import Callout from "@/components/Callout" import Card from "@/components/Card" @@ -46,8 +46,8 @@ const StyledCard = (props: ComponentPropsWithRef) => ( /> ) -const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { - const { locale } = await params +const Page = async ({ params }: { params: PageParams }) => { + const { locale } = params const t = await getTranslations({ locale, namespace: "page-wallets" }) setRequestLocale(locale) @@ -469,9 +469,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => { export async function generateMetadata({ params, }: { - params: Promise<{ locale: string }> + params: { locale: string } }) { - const { locale } = await params + const { locale } = params const t = await getTranslations({ locale, namespace: "page-wallets" }) diff --git a/app/[locale]/what-is-ethereum/page.tsx b/app/[locale]/what-is-ethereum/page.tsx index abd391559bd..f43b18017f8 100644 --- a/app/[locale]/what-is-ethereum/page.tsx +++ b/app/[locale]/what-is-ethereum/page.tsx @@ -8,7 +8,7 @@ import { } from "lucide-react" import { getTranslations } from "next-intl/server" -import type { CommitHistory, Lang, ToCItem } from "@/lib/types" +import type { CommitHistory, Lang, PageParams, ToCItem } from "@/lib/types" import DocLink from "@/components/DocLink" import FeedbackCard from "@/components/FeedbackCard" @@ -84,7 +84,7 @@ const HighlightCardContent = ({
) -const Page = async ({ params }: { params: { locale: Lang } }) => { +const Page = async ({ params }: { params: PageParams }) => { const { locale } = params const t = await getTranslations({ locale, diff --git a/src/lib/types.ts b/src/lib/types.ts index e5eb09d1df4..77c87f02988 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -1201,7 +1201,7 @@ export type ValuesPairing = { export type StablecoinType = "FIAT" | "CRYPTO" | "ASSET" | "ALGORITHMIC" export type PageParams = { - locale: string + locale: Lang } export type SlugPageParams = PageParams & {