wip
This commit is contained in:
@@ -7,7 +7,8 @@ import DriverProfile from '@/components/drivers/DriverProfile';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Breadcrumbs from '@/components/layout/Breadcrumbs';
|
||||
import { EntityMappers, DriverDTO } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import { EntityMappers } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import type { DriverDTO } from '@gridpilot/racing/application/dto/DriverDTO';
|
||||
|
||||
export default function DriverDetailPage() {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -17,7 +17,7 @@ import { Standing } from '@gridpilot/racing/domain/entities/Standing';
|
||||
import { Race } from '@gridpilot/racing/domain/entities/Race';
|
||||
import { Driver } from '@gridpilot/racing/domain/entities/Driver';
|
||||
import { getLeagueRepository, getRaceRepository, getDriverRepository, getStandingRepository } from '@/lib/di-container';
|
||||
import { getMembership, isOwnerOrAdmin, getCurrentDriverId } from '@gridpilot/racing/application';
|
||||
import { getMembership, isOwnerOrAdmin, getCurrentDriverId } from '@/lib/racingLegacyFacade';
|
||||
|
||||
export default function LeagueDetailPage() {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -4,7 +4,8 @@ import { useState, useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { getDriverRepository } from '@/lib/di-container';
|
||||
import { Driver } from '@gridpilot/racing/domain/entities/Driver';
|
||||
import { EntityMappers, DriverDTO } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import { EntityMappers } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import type { DriverDTO } from '@gridpilot/racing/application/dto/DriverDTO';
|
||||
import CreateDriverForm from '@/components/drivers/CreateDriverForm';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
@@ -14,7 +15,7 @@ import ProfileRaceHistory from '@/components/drivers/ProfileRaceHistory';
|
||||
import ProfileSettings from '@/components/drivers/ProfileSettings';
|
||||
import CareerHighlights from '@/components/drivers/CareerHighlights';
|
||||
import RatingBreakdown from '@/components/drivers/RatingBreakdown';
|
||||
import { getDriverTeam, getCurrentDriverId } from '@gridpilot/racing/application';
|
||||
import { getDriverTeam, getCurrentDriverId } from '@/lib/racingLegacyFacade';
|
||||
|
||||
type Tab = 'overview' | 'statistics' | 'history' | 'settings';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
registerForRace,
|
||||
withdrawFromRace,
|
||||
getRegisteredDrivers,
|
||||
} from '@gridpilot/racing/application';
|
||||
} from '@/lib/racingLegacyFacade';
|
||||
import CompanionStatus from '@/components/alpha/CompanionStatus';
|
||||
import CompanionInstructions from '@/components/alpha/CompanionInstructions';
|
||||
import Breadcrumbs from '@/components/layout/Breadcrumbs';
|
||||
@@ -71,7 +71,7 @@ export default function RaceDetailPage() {
|
||||
const driverRepo = getDriverRepository();
|
||||
const registeredDriverIds = getRegisteredDrivers(raceId);
|
||||
const drivers = await Promise.all(
|
||||
registeredDriverIds.map(id => driverRepo.findById(id))
|
||||
registeredDriverIds.map((id: string) => driverRepo.findById(id))
|
||||
);
|
||||
setEntryList(
|
||||
drivers.filter((d: Driver | null): d is Driver => d !== null)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { useParams } from 'next/navigation';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
removeTeamMember,
|
||||
updateTeamMemberRole,
|
||||
TeamRole,
|
||||
} from '@gridpilot/racing/application';
|
||||
} from '@/lib/racingLegacyFacade';
|
||||
|
||||
type Tab = 'overview' | 'roster' | 'standings' | 'admin';
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function TeamDetailPage() {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [isAdmin, setIsAdmin] = useState(false);
|
||||
|
||||
const loadTeamData = () => {
|
||||
const loadTeamData = useCallback(() => {
|
||||
const teamData = getTeam(teamId);
|
||||
if (!teamData) {
|
||||
setLoading(false);
|
||||
@@ -48,11 +48,11 @@ export default function TeamDetailPage() {
|
||||
setMemberships(teamMemberships);
|
||||
setIsAdmin(adminStatus);
|
||||
setLoading(false);
|
||||
};
|
||||
}, [teamId]);
|
||||
|
||||
useEffect(() => {
|
||||
loadTeamData();
|
||||
}, [teamId]);
|
||||
}, [loadTeamData]);
|
||||
|
||||
const handleUpdate = () => {
|
||||
loadTeamData();
|
||||
|
||||
@@ -7,7 +7,7 @@ import Button from '@/components/ui/Button';
|
||||
import Input from '@/components/ui/Input';
|
||||
import Card from '@/components/ui/Card';
|
||||
import CreateTeamForm from '@/components/teams/CreateTeamForm';
|
||||
import { getAllTeams, getTeamMembers, type Team } from '@gridpilot/racing/application';
|
||||
import { getAllTeams, getTeamMembers, type Team } from '@/lib/racingLegacyFacade';
|
||||
|
||||
export default function TeamsPage() {
|
||||
const router = useRouter();
|
||||
|
||||
Reference in New Issue
Block a user