website refactor

This commit is contained in:
2026-01-17 01:04:36 +01:00
parent 8ba46e96a6
commit 75ffe0798e
40 changed files with 267 additions and 321 deletions

View File

@@ -9,9 +9,9 @@ export default async function LeagueLayout({
params,
}: {
children: React.ReactNode;
params: { id: string };
params: Promise<{ id: string }>;
}) {
const leagueId = params.id;
const { id: leagueId } = await params;
// Execute PageQuery to get league data
const result = await LeagueDetailPageQuery.execute(leagueId);

View File

@@ -5,12 +5,13 @@ import { LeagueDetailViewDataBuilder } from '@/lib/builders/view-data/LeagueDeta
import { ErrorBanner } from '@/ui/ErrorBanner';
interface Props {
params: { id: string };
params: Promise<{ id: string }>;
}
export default async function Page({ params }: Props) {
const { id } = await params;
// Execute the PageQuery
const result = await LeagueDetailPageQuery.execute(params.id);
const result = await LeagueDetailPageQuery.execute(id);
// Handle different result types
if (result.isErr()) {

View File

@@ -3,11 +3,11 @@ import { RulebookTemplate } from '@/templates/RulebookTemplate';
import { notFound } from 'next/navigation';
interface Props {
params: { id: string };
params: Promise<{ id: string }>;
}
export default async function Page({ params }: Props) {
const leagueId = params.id;
const { id: leagueId } = await params;
if (!leagueId) {
notFound();

View File

@@ -3,11 +3,11 @@ import { LeagueScheduleTemplate } from '@/templates/LeagueScheduleTemplate';
import { notFound } from 'next/navigation';
interface Props {
params: { id: string };
params: Promise<{ id: string }>;
}
export default async function LeagueSchedulePage({ params }: Props) {
const leagueId = params.id;
const { id: leagueId } = await params;
if (!leagueId) {
notFound();

View File

@@ -3,11 +3,11 @@ import { LeagueSettingsTemplate } from '@/templates/LeagueSettingsTemplate';
import { notFound } from 'next/navigation';
interface Props {
params: { id: string };
params: Promise<{ id: string }>;
}
export default async function LeagueSettingsPage({ params }: Props) {
const leagueId = params.id;
const { id: leagueId } = await params;
if (!leagueId) {
notFound();

View File

@@ -3,11 +3,11 @@ import { LeagueSponsorshipsTemplate } from '@/templates/LeagueSponsorshipsTempla
import { notFound } from 'next/navigation';
interface Props {
params: { id: string };
params: Promise<{ id: string }>;
}
export default async function LeagueSponsorshipsPage({ params }: Props) {
const leagueId = params.id;
const { id: leagueId } = await params;
if (!leagueId) {
notFound();

View File

@@ -3,11 +3,11 @@ import { LeagueStandingsTemplate } from '@/templates/LeagueStandingsTemplate';
import { notFound } from 'next/navigation';
interface Props {
params: { id: string };
params: Promise<{ id: string }>;
}
export default async function Page({ params }: Props) {
const leagueId = params.id;
const { id: leagueId } = await params;
if (!leagueId) {
notFound();

View File

@@ -3,11 +3,11 @@ import { StewardingPageClient } from './StewardingPageClient';
import { notFound } from 'next/navigation';
interface Props {
params: { id: string };
params: Promise<{ id: string }>;
}
export default async function LeagueStewardingPage({ params }: Props) {
const leagueId = params.id;
const { id: leagueId } = await params;
if (!leagueId) {
notFound();