Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/[locale]/10years/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
22 changes: 7 additions & 15 deletions app/[locale]/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -28,16 +28,12 @@ import { getMdMetadata } from "@/lib/md/metadata"

const loadData = dataLoader([["gfissues", fetchGFIs]])

export default async function Page({
params,
}: {
params: Promise<SlugPageParams>
}) {
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()

Expand Down Expand Up @@ -128,12 +124,8 @@ export async function generateStaticParams() {
}
}

export async function generateMetadata({
params,
}: {
params: Promise<SlugPageParams>
}) {
const { locale, slug } = await params
export async function generateMetadata({ params }: { params: SlugPageParams }) {
const { locale, slug } = params

try {
return await getMdMetadata({
Expand Down
10 changes: 5 additions & 5 deletions app/[locale]/apps/[application]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down
13 changes: 7 additions & 6 deletions app/[locale]/apps/categories/[catetgoryName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import {

import {
AppCategoryEnum,
CommitHistory,
Lang,
type CommitHistory,
type Lang,
type PageParams,
type SectionNavDetails,
} from "@/lib/types"

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions app/[locale]/apps/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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({
Expand Down
14 changes: 5 additions & 9 deletions app/[locale]/assets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)

Expand Down Expand Up @@ -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" })

Expand Down
4 changes: 2 additions & 2 deletions app/[locale]/bug-bounty/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -798,9 +798,9 @@ export default async function Page({ params }: { params: Promise<Params> }) {
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" })

Expand Down
14 changes: 5 additions & 9 deletions app/[locale]/collectibles/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions app/[locale]/community/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions app/[locale]/developers/learning-tools/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
Loading