diff --git a/apps/web/app/(public)/layout.tsx b/apps/web/app/(public)/layout.tsx index e32a8ec..55abb00 100644 --- a/apps/web/app/(public)/layout.tsx +++ b/apps/web/app/(public)/layout.tsx @@ -4,6 +4,15 @@ import { Button } from '@ui/button' import { Path } from '@/lib/utils/path' import { getMaybeSession } from '@/lib/dal' import { webRoutes } from '@gridtip/shared/routes' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: { + absolute: 'GridTip – F1 Tipping with Friends', + }, + description: + 'Predict the outcome of every Formula One race weekend with your friends. Join a group, tip the podium, and battle for the tipping championship.', +} export default async function DefaultLayout({ children, diff --git a/apps/web/app/tipping/add-tips/[race-id]/page.tsx b/apps/web/app/tipping/add-tips/[race-id]/page.tsx index 3e0d4f0..d9e17eb 100644 --- a/apps/web/app/tipping/add-tips/[race-id]/page.tsx +++ b/apps/web/app/tipping/add-tips/[race-id]/page.tsx @@ -21,6 +21,25 @@ import { getTips } from '@/lib/get-tips' import { getIsSprint } from '@gridtip/shared/is-sprint' import { getDriverOptions } from '@/lib/utils/drivers' import { getConstructorOptions } from '@/lib/utils/constructors' +import type { Metadata } from 'next' + +export async function generateMetadata({ + params, +}: { + params: Promise<{ 'race-id': string }> +}): Promise { + const { 'race-id': raceId } = await params + const race = await getRaceDetails(raceId) + + if (!race) { + return { title: 'Enter tips' } + } + + return { + title: race.raceName, + description: `Tip the ${race.raceName}.`, + } +} export default async function RaceFormPage({ params, diff --git a/apps/web/app/tipping/add-tips/page.tsx b/apps/web/app/tipping/add-tips/page.tsx index eb020c2..e2ece26 100644 --- a/apps/web/app/tipping/add-tips/page.tsx +++ b/apps/web/app/tipping/add-tips/page.tsx @@ -6,6 +6,7 @@ import { redirect } from 'next/navigation' export const metadata: Metadata = { title: 'Enter tips', + description: 'Tip the next Formula One Grand Prix weekend.', } export default async function AddTipping() { diff --git a/apps/web/app/tipping/championships/page.tsx b/apps/web/app/tipping/championships/page.tsx index 0affd70..ad8cf1a 100644 --- a/apps/web/app/tipping/championships/page.tsx +++ b/apps/web/app/tipping/championships/page.tsx @@ -27,6 +27,13 @@ import { ChampionshipsTipData } from './actions/schema' import { getFirstRace } from '@/lib/utils/races' import { getDriverOptions } from '@/lib/utils/drivers' import { getConstructorOptions } from '@/lib/utils/constructors' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Championships', + description: + 'Predict the Formula One Drivers’ and Constructors’ champions for the season.', +} export default async function ChampionshipPage() { const { userId } = await verifySession() diff --git a/apps/web/app/tipping/group-admin/page.tsx b/apps/web/app/tipping/group-admin/page.tsx index 6ba6de0..f9f8420 100644 --- a/apps/web/app/tipping/group-admin/page.tsx +++ b/apps/web/app/tipping/group-admin/page.tsx @@ -18,6 +18,13 @@ import { ChampionshipPoints } from './_components/championship-points' import { getRaces } from '@/lib/utils/races' import { getConstructorOptions } from '@/lib/utils/constructors' import { getDriverOptions } from '@/lib/utils/drivers' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Group Admin', + description: + 'Manage tips and championship points for members of your tipping group.', +} export default async function GroupSettings() { const { userId } = await verifySession() diff --git a/apps/web/app/tipping/groups/page.tsx b/apps/web/app/tipping/groups/page.tsx index cb7897c..b073e60 100644 --- a/apps/web/app/tipping/groups/page.tsx +++ b/apps/web/app/tipping/groups/page.tsx @@ -25,6 +25,13 @@ import { Badge } from '@/components/ui/badge' import { Suspense } from 'react' import EditGroup from './_components/edit-group' import { MemberStatus } from '@/types' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Groups', + description: + 'Manage your tipping groups, invite friends, or join an existing group.', +} export default async function GroupsPage() { const { userId, user } = await verifySession() diff --git a/apps/web/app/tipping/page.tsx b/apps/web/app/tipping/page.tsx index 28e8469..a1606c8 100644 --- a/apps/web/app/tipping/page.tsx +++ b/apps/web/app/tipping/page.tsx @@ -51,6 +51,13 @@ import { FlagBackgroundCard } from './_components/card-flag-background' import { CardEveryonesTips } from './_components/card-group-tips' import { RaceHeader } from './_components/race-header' import { getIsSprint } from '@gridtip/shared/is-sprint' +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Dashboard', + description: + 'Your tipping dashboard – see the next race and group tips.', +} export default async function DashboardPage() { const { userId, user: _ } = await verifySession()