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
4 changes: 2 additions & 2 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const path = require("path")

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames
`eslint --fix ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(" --file ")}`
.join(" ")}`

const formatCommand = "prettier --write"

Expand Down
7 changes: 2 additions & 5 deletions app/[locale]/10years/_components/TenYearHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import Morpher from "@/components/Morpher/lazy"
import TenYearBackgroundImage from "@/public/images/10-year-anniversary/10-year-background.png"
import TenYearGraphicImage from "@/public/images/10-year-anniversary/10-year-graphic.png"

const TenYearHero = async ({ locale }: { locale: string }) => {
const t = await getTranslations({
locale,
namespace: "page-10-year-anniversary",
})
const TenYearHero = async () => {
const t = await getTranslations("page-10-year-anniversary")

const WORDS = [
t("page-10-year-censorship-resistance"),
Expand Down
14 changes: 3 additions & 11 deletions app/[locale]/10years/_components/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getLocale, getTranslations } from "next-intl/server"
import { getTranslations } from "next-intl/server"

import { formatDate, isValidDate } from "@/lib/utils/date"

Expand Down Expand Up @@ -46,11 +46,7 @@ export const parseStoryDates = (
}))

export const getInnovationCards = async (): Promise<InnovationCard[]> => {
const locale = await getLocale()
const t = await getTranslations({
locale,
namespace: "page-10-year-anniversary",
})
const t = await getTranslations("page-10-year-anniversary")
return [
{
image: EthereumLaunchImage,
Expand Down Expand Up @@ -80,11 +76,7 @@ export const getInnovationCards = async (): Promise<InnovationCard[]> => {
}

export const getAdoptionCards = async (): Promise<AdoptionCard[]> => {
const locale = await getLocale()
const t = await getTranslations({
locale,
namespace: "page-10-year-anniversary",
})
const t = await getTranslations("page-10-year-anniversary")
return [
{
image: Adoption1Image,
Expand Down
4 changes: 1 addition & 3 deletions app/[locale]/10years/page-jsonld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export default async function TenYearJsonLD({
locale: string
contributors: FileContributor[]
}) {
const t = await getTranslations({
namespace: "page-10-year-anniversary",
})
const t = await getTranslations("page-10-year-anniversary")

const url = normalizeUrlForJsonLd(locale, "/10years/")

Expand Down
12 changes: 3 additions & 9 deletions app/[locale]/10years/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ const Page = async (props: { params: Promise<PageParams> }) => {
const requiredNamespaces = getRequiredNamespacesForPage("/10years")
const messages = pick(allMessages, requiredNamespaces)

const t = await getTranslations({
locale,
namespace: "page-10-year-anniversary",
})
const t = await getTranslations("page-10-year-anniversary")

const innovationCards = await getInnovationCards()
const adoptionCards = await getAdoptionCards()
Expand All @@ -74,7 +71,7 @@ const Page = async (props: { params: Promise<PageParams> }) => {
<>
<TenYearJsonLD locale={locale} contributors={contributors} />
<MainArticle className="mx-auto flex w-full flex-col items-center">
<TenYearHero locale={locale} />
<TenYearHero />

<div
className={cn(
Expand Down Expand Up @@ -382,10 +379,7 @@ export async function generateMetadata(props: {
const params = await props.params
const { locale } = params

const t = await getTranslations({
locale,
namespace: "page-10-year-anniversary",
})
const t = await getTranslations("page-10-year-anniversary")

return await getMetadata({
locale,
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export async function generateMetadata(props: {
slug,
})
} catch (error) {
const t = await getTranslations({ locale, namespace: "common" })
const t = await getTranslations("common")

// Return basic metadata for invalid paths
return {
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/apps/[application]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Page = async (props: {
setRequestLocale(locale)

// Get translations
const t = await getTranslations({ locale, namespace: "page-apps" })
const t = await getTranslations("page-apps")

// Get i18n messages
const allMessages = await getMessages({ locale })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async function AppsCategoryJsonLD({
appsData: Record<string, AppData[]>
contributors: FileContributor[]
}) {
const t = await getTranslations({ namespace: "page-apps" })
const t = await getTranslations("page-apps")

const url = normalizeUrlForJsonLd(locale, `/apps/categories/${categoryName}`)
// Get apps for this category
Expand Down
4 changes: 2 additions & 2 deletions app/[locale]/apps/categories/[catetgoryName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Page = async (props: {
throw new Error("Failed to fetch apps data")
}

const t = await getTranslations({ locale, namespace: "page-apps" })
const t = await getTranslations("page-apps")

// Get i18n messages
const allMessages = await getMessages({ locale })
Expand Down Expand Up @@ -184,7 +184,7 @@ export async function generateMetadata(props: {
}) {
const params = await props.params
const { locale, catetgoryName } = params
const t = await getTranslations({ locale, namespace: "page-apps" })
const t = await getTranslations("page-apps")

// Normalize slug to lowercase
const normalizedSlug = catetgoryName.toLowerCase()
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/apps/page-jsonld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default async function AppsJsonLD({
locale: string
contributors: FileContributor[]
}) {
const t = await getTranslations({ namespace: "page-apps" })
const t = await getTranslations("page-apps")

const url = normalizeUrlForJsonLd(locale, "/apps/")

Expand Down
4 changes: 2 additions & 2 deletions app/[locale]/apps/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Page = async (props: { params: Promise<PageParams> }) => {
const discoverApps = getDiscoverApps(appsData, 6)

// Get translations
const t = await getTranslations({ locale, namespace: "page-apps" })
const t = await getTranslations("page-apps")

// Get i18n messages
const allMessages = await getMessages({ locale })
Expand Down Expand Up @@ -174,7 +174,7 @@ export async function generateMetadata(props: {
}) {
const params = await props.params
const { locale } = params
const t = await getTranslations({ locale, namespace: "page-apps" })
const t = await getTranslations("page-apps")

return await getMetadata({
locale,
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/assets/page-jsonld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function AssetsJsonLD({
locale: string
contributors: FileContributor[]
}) {
const t = await getTranslations({ namespace: "page-assets" })
const t = await getTranslations("page-assets")

const url = normalizeUrlForJsonLd(locale, `/assets/`)

Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/assets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function generateMetadata(props: {
const params = await props.params
const { locale } = params

const t = await getTranslations({ locale, namespace: "page-assets" })
const t = await getTranslations("page-assets")

return await getMetadata({
locale,
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/bug-bounty/page-jsonld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function BugBountyJsonLD({
locale: string
contributors: FileContributor[]
}) {
const t = await getTranslations({ namespace: "page-bug-bounty" })
const t = await getTranslations("page-bug-bounty")

const url = normalizeUrlForJsonLd(locale, `/bug-bounty/`)

Expand Down
6 changes: 3 additions & 3 deletions app/[locale]/bug-bounty/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ export default async function Page(props: { params: Promise<Params> }) {
const params = await props.params
const { locale } = params

const t = await getTranslations({ namespace: "page-bug-bounty" })
const tCommon = await getTranslations({ namespace: "common" })
const t = await getTranslations("page-bug-bounty")
const tCommon = await getTranslations("common")

const { contributors, lastEditLocaleTimestamp } =
await getAppPageContributorInfo("bug-bounty", locale as Lang)
Expand Down Expand Up @@ -840,7 +840,7 @@ export async function generateMetadata(props: {
const params = await props.params
const { locale } = params

const t = await getTranslations({ locale, namespace: "page-bug-bounty" })
const t = await getTranslations("page-bug-bounty")

return await getMetadata({
locale,
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/collectibles/page-jsonld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function CollectiblesJsonLD({
stats: Stats
contributors: FileContributor[]
}) {
const t = await getTranslations({ namespace: "page-collectibles" })
const t = await getTranslations("page-collectibles")

const url = normalizeUrlForJsonLd(locale, `/collectibles/`)

Expand Down
4 changes: 2 additions & 2 deletions app/[locale]/collectibles/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function fetchStats() {
export default async function Page(props: { params: Promise<PageParams> }) {
const params = await props.params
const { locale } = params
const t = await getTranslations({ locale, namespace: "page-collectibles" })
const t = await getTranslations("page-collectibles")
setRequestLocale(locale)

// Fetch data
Expand Down Expand Up @@ -159,7 +159,7 @@ export async function generateMetadata(props: {
}) {
const params = await props.params
const { locale } = params
const t = await getTranslations({ locale, namespace: "page-collectibles" })
const t = await getTranslations("page-collectibles")
return await getMetadata({
locale,
slug: ["collectibles"],
Expand Down
8 changes: 2 additions & 6 deletions app/[locale]/community/events/_components/OrganizerCTA.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getLocale, getTranslations } from "next-intl/server"
import { getTranslations } from "next-intl/server"

import { ButtonLink } from "@/components/ui/buttons/Button"
import { Section } from "@/components/ui/section"
Expand All @@ -10,11 +10,7 @@ interface OrganizerCTAProps {
}

export default async function OrganizerCTA({ className }: OrganizerCTAProps) {
const locale = await getLocale()
const t = await getTranslations({
locale,
namespace: "page-community-events",
})
const t = await getTranslations("page-community-events")

return (
<Section
Expand Down
10 changes: 2 additions & 8 deletions app/[locale]/community/events/conferences/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ const Page = async (props: { params: Promise<PageParams> }) => {

const _events = (await getEventsData()) ?? []

const t = await getTranslations({
locale,
namespace: "page-community-events",
})
const t = await getTranslations("page-community-events")

// Apply translations and compute eventTypes from tags if missing
const events = mapEventTranslations(_events, t)
Expand Down Expand Up @@ -140,10 +137,7 @@ export async function generateMetadata(props: {
}) {
const params = await props.params
const { locale } = params
const t = await getTranslations({
locale,
namespace: "page-community-events",
})
const t = await getTranslations("page-community-events")

const year = getLocaleYear(locale)

Expand Down
10 changes: 2 additions & 8 deletions app/[locale]/community/events/meetups/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ const Page = async (props: { params: Promise<PageParams> }) => {

const _events = (await getEventsData()) ?? []

const t = await getTranslations({
locale,
namespace: "page-community-events",
})
const t = await getTranslations("page-community-events")

// Apply translations and compute eventTypes from tags if missing
const events = mapEventTranslations(_events, t)
Expand Down Expand Up @@ -82,10 +79,7 @@ export async function generateMetadata(props: {
}) {
const params = await props.params
const { locale } = params
const t = await getTranslations({
locale,
namespace: "page-community-events",
})
const t = await getTranslations("page-community-events")

const year = getLocaleYear(locale)

Expand Down
4 changes: 2 additions & 2 deletions app/[locale]/community/events/page-jsonld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export default async function EventsJsonLD({
locale: string
contributors: FileContributor[]
}) {
const t = await getTranslations({ namespace: "page-community-events" })
const common = await getTranslations({ namespace: "common" })
const t = await getTranslations("page-community-events")
const common = await getTranslations("common")

const year = getLocaleYear(locale)
const url = normalizeUrlForJsonLd(locale, `/community/events/`)
Expand Down
10 changes: 2 additions & 8 deletions app/[locale]/community/events/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ const Page = async (props: { params: Promise<PageParams> }) => {

const _events = (await getEventsData()) ?? []

const t = await getTranslations({
locale,
namespace: "page-community-events",
})
const t = await getTranslations("page-community-events")

const allMessages = await getMessages({ locale })
const requiredNamespaces = getRequiredNamespacesForPage("/community/events")
Expand Down Expand Up @@ -585,10 +582,7 @@ export async function generateMetadata(props: {
}) {
const params = await props.params
const { locale } = params
const t = await getTranslations({
locale,
namespace: "page-community-events",
})
const t = await getTranslations("page-community-events")

const year = getLocaleYear(locale)

Expand Down
12 changes: 3 additions & 9 deletions app/[locale]/community/events/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ const Page = async (props: {

const _events = (await getEventsData()) ?? []

const t = await getTranslations({
locale,
namespace: "page-community-events",
})
const tCommon = await getTranslations({ locale, namespace: "common" })
const t = await getTranslations("page-community-events")
const tCommon = await getTranslations("common")

const events = mapEventTranslations(_events, t)

Expand Down Expand Up @@ -151,10 +148,7 @@ export async function generateMetadata(props: {
}) {
const params = await props.params
const { locale } = params
const t = await getTranslations({
locale,
namespace: "page-community-events",
})
const t = await getTranslations("page-community-events")

return await getMetadata({
locale,
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/community/page-jsonld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function CommunityJsonLD({
locale: string
contributors: FileContributor[]
}) {
const t = await getTranslations({ namespace: "page-community" })
const t = await getTranslations("page-community")

const url = normalizeUrlForJsonLd(locale, `/community/`)

Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/community/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function generateMetadata(props: {
const params = await props.params
const { locale } = params

const t = await getTranslations({ locale, namespace: "page-community" })
const t = await getTranslations("page-community")
return await getMetadata({
locale,
slug: ["community"],
Expand Down
Loading
Loading