This commit is contained in:
2025-12-18 14:30:19 +01:00
parent bf1f09c774
commit b476bb7e99
29 changed files with 273 additions and 307 deletions

View File

@@ -1,28 +1,27 @@
'use client';
import { useState, useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useEffectiveDriverId } from '@/lib/currentDriver';
import type { NotificationUrgency } from '@core/notifications/application';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import {
Bell,
AlertCircle,
AlertTriangle,
Vote,
Shield,
Award,
Bell,
BellRing,
Building2,
ChevronDown,
ChevronUp,
LogIn,
LogOut,
MessageSquare,
Shield,
TrendingUp,
User,
Vote,
Wrench,
X,
MessageSquare,
AlertCircle,
BellRing,
User,
Building2,
LogOut,
LogIn,
TrendingUp,
Award,
} from 'lucide-react';
import { useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';
type DemoNotificationType = 'protest_filed' | 'defense_requested' | 'vote_required' | 'race_performance_summary' | 'race_final_results';
type DemoUrgency = 'silent' | 'toast' | 'modal';

View File

@@ -1,9 +1,9 @@
'use client';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import { getMembership } from '@/lib/leagueMembership';
import { useState } from 'react';
import Button from '../ui/Button';
import { getMembership, type MembershipStatus } from '@/lib/leagueMembership';
import { useEffectiveDriverId } from '@/lib/currentDriver';
interface JoinLeagueButtonProps {
leagueId: string;

View File

@@ -1,41 +1,41 @@
'use client';
import { useState, useEffect, useCallback } from 'react';
import { useRouter, useSearchParams, usePathname } from 'next/navigation';
import Button from '../ui/Button';
import Card from '../ui/Card';
import LeagueMembers from './LeagueMembers';
import ScheduleRaceForm from './ScheduleRaceForm';
import DriverIdentity from '@/components/drivers/DriverIdentity';
import DriverSummaryPill from '@/components/profile/DriverSummaryPill';
import Modal from '@/components/ui/Modal';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import type { MembershipRole } from '@/lib/leagueMembership';
import type { LeagueSummaryViewModel } from '@/lib/presenters/LeagueAdminPresenter';
import {
loadLeagueJoinRequests,
approveLeagueJoinRequest,
rejectLeagueJoinRequest,
loadLeagueOwnerSummary,
loadLeagueConfig,
loadLeagueJoinRequests,
loadLeagueOwnerSummary,
loadLeagueProtests,
loadLeagueSeasons,
rejectLeagueJoinRequest,
removeLeagueMember as removeLeagueMemberCommand,
updateLeagueMemberRole as updateLeagueMemberRoleCommand,
loadLeagueSeasons,
type LeagueAdminProtestsViewModel,
type LeagueJoinRequestViewModel,
type LeagueOwnerSummaryViewModel,
type LeagueAdminProtestsViewModel,
type LeagueSeasonSummaryViewModel,
} from '@/lib/presenters/LeagueAdminPresenter';
import type { LeagueConfigFormModel } from '@core/racing/application';
import type { LeagueSummaryViewModel } from '@/lib/presenters/LeagueAdminPresenter';
import { AlertTriangle, Calendar, Car, CheckCircle, Clock, DollarSign, Download, Flag, Paintbrush, Trophy, Upload, User, Wallet, XCircle } from 'lucide-react';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { useCallback, useEffect, useState } from 'react';
import Button from '../ui/Button';
import Card from '../ui/Card';
import { LeagueBasicsSection } from './LeagueBasicsSection';
import { LeagueStructureSection } from './LeagueStructureSection';
import { LeagueScoringSection } from './LeagueScoringSection';
import { LeagueDropSection } from './LeagueDropSection';
import { LeagueTimingsSection } from './LeagueTimingsSection';
import { LeagueSponsorshipsSection } from './LeagueSponsorshipsSection';
import LeagueMembers from './LeagueMembers';
import { LeagueMembershipFeesSection } from './LeagueMembershipFeesSection';
import { useEffectiveDriverId } from '@/lib/currentDriver';
import type { MembershipRole } from '@/lib/leagueMembership';
import DriverSummaryPill from '@/components/profile/DriverSummaryPill';
import DriverIdentity from '@/components/drivers/DriverIdentity';
import Modal from '@/components/ui/Modal';
import { AlertTriangle, CheckCircle, Clock, XCircle, Flag, Calendar, User, DollarSign, Wallet, Paintbrush, Trophy, Download, Car, Upload } from 'lucide-react';
import { LeagueScoringSection } from './LeagueScoringSection';
import { LeagueSponsorshipsSection } from './LeagueSponsorshipsSection';
import { LeagueStructureSection } from './LeagueStructureSection';
import { LeagueTimingsSection } from './LeagueTimingsSection';
import ScheduleRaceForm from './ScheduleRaceForm';
type JoinRequest = LeagueJoinRequestViewModel;

View File

@@ -1,15 +1,15 @@
'use client';
import { useState, useEffect, useCallback } from 'react';
import DriverIdentity from '@/components/drivers/DriverIdentity';
import type { DriverDTO } from '@core/racing/application/dto/DriverDTO';
import { EntityMappers } from '@core/racing/application/mappers/EntityMappers';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import {
getLeagueMembers,
type LeagueMembership,
type MembershipRole,
} from '@/lib/leagueMembership';
import { useEffectiveDriverId } from '@/lib/currentDriver';
import type { DriverDTO } from '@core/racing/application/dto/DriverDTO';
import { EntityMappers } from '@core/racing/application/mappers/EntityMappers';
import { useCallback, useEffect, useState } from 'react';
interface LeagueMembersProps {
leagueId: string;

View File

@@ -1,10 +1,9 @@
'use client';
import { useState, useEffect, useCallback } from 'react';
import { useRouter } from 'next/navigation';
import { useEffectiveDriverId } from '@/lib/currentDriver';
import { createLeagueSchedulePresenter } from '@/lib/presenters/factories';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import type { LeagueScheduleRaceItemViewModel } from '@/lib/presenters/LeagueSchedulePresenter';
import { useRouter } from 'next/navigation';
import { useCallback, useEffect, useState } from 'react';
interface LeagueScheduleProps {
leagueId: string;

View File

@@ -1,13 +1,13 @@
'use client';
import { useState, useEffect, useCallback } from 'react';
import { Award, DollarSign, Star, X } from 'lucide-react';
import { useCallback, useEffect, useState } from 'react';
import PendingSponsorshipRequests, { type PendingRequestDTO } from '../sponsors/PendingSponsorshipRequests';
import Button from '../ui/Button';
import Input from '../ui/Input';
import { DollarSign, Star, Award, Plus, X, Bell } from 'lucide-react';
import PendingSponsorshipRequests, { type PendingRequestDTO } from '../sponsors/PendingSponsorshipRequests';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import { PendingSponsorshipRequestsPresenter } from '@/lib/presenters/PendingSponsorshipRequestsPresenter';
import { useEffectiveDriverId } from '@/lib/currentDriver';
interface SponsorshipSlot {
tier: 'main' | 'secondary';

View File

@@ -1,7 +1,7 @@
'use client';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import { getMembership, type MembershipRole } from '@/lib/leagueMembership';
import { useEffectiveDriverId } from '@/lib/currentDriver';
interface MembershipStatusProps {
leagueId: string;

View File

@@ -1,23 +1,20 @@
'use client';
import React, { useState, useEffect, useRef } from 'react';
import { useRouter } from 'next/navigation';
import Link from 'next/link';
import { useEffectiveDriverId } from '@/lib/currentDriver';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import type { Notification } from '@core/notifications/application';
import {
Bell,
AlertTriangle,
Shield,
Vote,
Trophy,
Users,
Flag,
X,
Check,
Bell,
CheckCheck,
ExternalLink,
Flag,
Shield,
Trophy,
Users,
Vote
} from 'lucide-react';
import { useRouter } from 'next/navigation';
import { useEffect, useRef, useState } from 'react';
const notificationIcons: Record<string, typeof Bell> = {
protest_filed: AlertTriangle,

View File

@@ -1,11 +1,11 @@
'use client';
import { createContext, useContext, useState, useEffect, useCallback, ReactNode } from 'react';
import { useEffectiveDriverId } from '@/lib/currentDriver';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import { createContext, ReactNode, useCallback, useContext, useEffect, useState } from 'react';
import type { Notification } from '@core/notifications/application';
import ToastNotification from './ToastNotification';
import ModalNotification from './ModalNotification';
import ToastNotification from './ToastNotification';
interface NotificationContextValue {
notifications: Notification[];

View File

@@ -1,15 +1,15 @@
'use client';
import { useAuth } from '@/lib/auth/AuthContext';
import { AnimatePresence, motion, useReducedMotion } from 'framer-motion';
import { BarChart3, Building2, ChevronDown, CreditCard, Handshake, LogOut, Megaphone, Paintbrush, Settings, TrendingUp, Trophy } from 'lucide-react';
import Link from 'next/link';
import { useEffect, useMemo, useState } from 'react';
import { motion, AnimatePresence, useReducedMotion } from 'framer-motion';
import { LogOut, Settings, Star, Paintbrush, Building2, BarChart3, Megaphone, CreditCard, Handshake, ChevronDown, TrendingUp, Trophy } from 'lucide-react';
import { useAuth } from '@/lib/auth/AuthContext';
import { useEffectiveDriverId } from '@/lib/currentDriver';
import DriverSummaryPill from '@/components/profile/DriverSummaryPill';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import type { DriverDTO } from '@core/racing/application/dto/DriverDTO';
import { EntityMappers } from '@core/racing/application/mappers/EntityMappers';
import DriverSummaryPill from '@/components/profile/DriverSummaryPill';
// Hook to detect sponsor mode
function useSponsorMode(): boolean {

View File

@@ -1,10 +1,10 @@
'use client';
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import Button from '@/components/ui/Button';
import Input from '@/components/ui/Input';
import { useEffectiveDriverId } from '@/lib/currentDriver';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import { useRouter } from 'next/navigation';
import { useState } from 'react';
interface CreateTeamFormProps {
onCancel?: () => void;

View File

@@ -1,8 +1,8 @@
'use client';
import { useState, useEffect } from 'react';
import Button from '@/components/ui/Button';
import { useEffectiveDriverId } from '@/lib/currentDriver';
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import { useEffect, useState } from 'react';
type TeamMembershipStatus = 'active' | 'pending' | 'inactive';