diff --git a/app/tournaments/[year]/page.tsx b/app/tournaments/[year]/page.tsx index 2fa87c1..d50e92b 100644 --- a/app/tournaments/[year]/page.tsx +++ b/app/tournaments/[year]/page.tsx @@ -1,6 +1,6 @@ 'use client' import { useQuery, gql } from '@/lib/graphql/hooks' -import { use } from 'react' +import { use, useEffect } from 'react' import Link from 'next/link' import { TeamFlag } from '@/components/team-flag' import { MatchCard } from '@/components/match-card' @@ -64,6 +64,14 @@ export default function TournamentPage({ params }: { params: Promise<{ year: str const year = parseInt(yearStr) const { data, loading } = useQuery(TOURNAMENT_QUERY, { variables: { year }, pollInterval: year === 2026 ? 60_000 : 0 }) + useEffect(() => { + if (!data) return + const hash = window.location.hash + if (!hash) return + const el = document.getElementById(hash.slice(1)) + if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' }) + }, [data]) + const t = data?.tournament const standings: Standing[] = data?.groupStandings ?? [] const byGroup = standings.reduce>((acc, s) => {