Skip to content
Open
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
9 changes: 9 additions & 0 deletions apps/web/app/(public)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
19 changes: 19 additions & 0 deletions apps/web/app/tipping/add-tips/[race-id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Metadata> {
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,
Expand Down
1 change: 1 addition & 0 deletions apps/web/app/tipping/add-tips/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
7 changes: 7 additions & 0 deletions apps/web/app/tipping/championships/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 7 additions & 0 deletions apps/web/app/tipping/group-admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 7 additions & 0 deletions apps/web/app/tipping/groups/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 7 additions & 0 deletions apps/web/app/tipping/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading