fix: update document.title on every page via useEffect
All pages are 'use client' so metadata exports don't work. Each page now sets document.title via useEffect — static pages with a fixed string, dynamic pages keyed on data so the title reflects the loaded content. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use client'
|
||||
import { useQuery, gql } from '@/lib/graphql/hooks'
|
||||
import { useEffect } from 'react'
|
||||
import Link from 'next/link'
|
||||
import { TeamFlag } from '@/components/team-flag'
|
||||
|
||||
@@ -22,6 +23,8 @@ interface Standing {
|
||||
export default function GroupsPage() {
|
||||
const { data, loading } = useQuery(GROUPS_QUERY, { pollInterval: 60_000 })
|
||||
|
||||
useEffect(() => { document.title = 'Group Stage · World Cup' }, [])
|
||||
|
||||
const standings: Standing[] = data?.groupStandings ?? []
|
||||
const byGroup = standings.reduce<Record<string, Standing[]>>((acc, s) => {
|
||||
acc[s.groupName] = [...(acc[s.groupName] ?? []), s]
|
||||
|
||||
Reference in New Issue
Block a user