diff --git a/apps/website/components/leagues/CreateLeagueWizard.tsx b/apps/website/components/leagues/CreateLeagueWizard.tsx index 810f09619..dee72ea7d 100644 --- a/apps/website/components/leagues/CreateLeagueWizard.tsx +++ b/apps/website/components/leagues/CreateLeagueWizard.tsx @@ -2,10 +2,20 @@ import { useEffect, useState, FormEvent } from 'react'; import { useRouter } from 'next/navigation'; +import { + FileText, + Users, + Calendar, + Trophy, + Award, + CheckCircle2, + ChevronLeft, + ChevronRight +} from 'lucide-react'; import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; import Heading from '@/components/ui/Heading'; -import LeagueReviewSummary from './LeagueReviewSummary'; +import LeagueReviewSummary from '@/components/leagues/LeagueReviewSummary'; import { getDriverRepository, getListLeagueScoringPresetsQuery, @@ -365,12 +375,12 @@ export default function CreateLeagueWizard() { }; const steps = [ - { id: 1 as Step, label: 'Basics' }, - { id: 2 as Step, label: 'Structure' }, - { id: 3 as Step, label: 'Schedule & timings' }, - { id: 4 as Step, label: 'Scoring pattern' }, - { id: 5 as Step, label: 'Championships & drops' }, - { id: 6 as Step, label: 'Review & confirm' }, + { id: 1 as Step, label: 'Basics', icon: FileText }, + { id: 2 as Step, label: 'Structure', icon: Users }, + { id: 3 as Step, label: 'Schedule', icon: Calendar }, + { id: 4 as Step, label: 'Scoring', icon: Trophy }, + { id: 5 as Step, label: 'Championships', icon: Award }, + { id: 6 as Step, label: 'Review', icon: CheckCircle2 }, ]; const getStepTitle = (currentStep: Step): string => { @@ -412,35 +422,56 @@ export default function CreateLeagueWizard() { }; return ( -
- - Create a new league - -

- Configure basics, structure, schedule, scoring, and drop rules in a few - simple steps. -

+ + {/* Header */} +
+ + Create a new league + +

+ Configure your league in {steps.length} simple steps +

+
-
-
+ {/* Progress indicators */} +
+
{steps.map((wizardStep, index) => { const isCompleted = wizardStep.id < step; const isCurrent = wizardStep.id === step; - const baseCircleClasses = - 'flex h-7 w-7 items-center justify-center rounded-full text-xs font-semibold'; - const circleClasses = isCurrent - ? 'bg-primary-blue text-white' - : isCompleted - ? 'bg-primary-blue/20 border border-primary-blue text-primary-blue' - : 'bg-iron-gray border border-charcoal-outline text-gray-400'; + const StepIcon = wizardStep.icon; return ( -
-
- {isCompleted ? '✓' : wizardStep.id} +
+
+ {index > 0 && ( +
+ )} +
+ {isCompleted ? ( + + ) : ( + + )} +
{wizardStep.label} - {index < steps.length - 1 && ( - - )}
); })}
- -
- - {getStepTitle(step)} - -

- {getStepSubtitle(step)} -

-
+ {/* Main content card */} + + {/* Decorative gradient */} +
+ +
+ {/* Step header */} +
+
+
+ {(() => { + const currentStepData = steps.find((s) => s.id === step); + if (!currentStepData) return null; + const Icon = currentStepData.icon; + return ; + })()} +
+
+ + {getStepTitle(step)} + +

+ {getStepSubtitle(step)} +

+
+ + Step {step} of {steps.length} + +
+
+ +
+ + {/* Step content */} +
+ + {step === 1 && ( + + )} + + {step === 2 && ( + + )} + + {step === 3 && ( + + )} + + {step === 4 && ( +
+ + setForm((prev) => ({ + ...prev, + scoring: { + ...prev.scoring, + patternId, + customScoringEnabled: false, + }, + })) + } + onToggleCustomScoring={() => + setForm((prev) => ({ + ...prev, + scoring: { + ...prev.scoring, + customScoringEnabled: !prev.scoring.customScoringEnabled, + }, + })) + } + /> +
+ )} + + {step === 5 && ( +
+
+ +
+
+ +
+ + {errors.submit && ( +
+
⚠️
+
{errors.submit}
+
+ )} +
+ )} + + {step === 6 && ( +
+ + {errors.submit && ( +
+
⚠️
+
{errors.submit}
+
+ )} +
+ )} +
- - {step === 1 && ( - - )} - - {step === 2 && ( - - )} - - {step === 3 && ( - - )} - - {step === 4 && ( -
- - setForm((prev) => ({ - ...prev, - scoring: { - ...prev.scoring, - patternId, - customScoringEnabled: false, - }, - })) - } - onToggleCustomScoring={() => - setForm((prev) => ({ - ...prev, - scoring: { - ...prev.scoring, - customScoringEnabled: !prev.scoring.customScoringEnabled, - }, - })) - } - /> -
- )} - - {step === 5 && ( -
-
- -
-
- -
- - {errors.submit && ( -
- {errors.submit} -
- )} -
- )} - - {step === 6 && ( -
- - {errors.submit && ( -
- {errors.submit} -
- )} -
- )} -
+ {/* Navigation buttons */} +
-
+
{step < 6 && ( )} {step === 6 && ( - )}
diff --git a/apps/website/components/leagues/LeagueBasicsSection.tsx b/apps/website/components/leagues/LeagueBasicsSection.tsx index dda7e331c..1b6025398 100644 --- a/apps/website/components/leagues/LeagueBasicsSection.tsx +++ b/apps/website/components/leagues/LeagueBasicsSection.tsx @@ -1,5 +1,6 @@ 'use client'; +import { FileText, Globe, Lock, Gamepad2 } from 'lucide-react'; import Input from '@/components/ui/Input'; import type { LeagueConfigFormModel, @@ -37,91 +38,143 @@ export function LeagueBasicsSection({ return (
-

Step 1 — Basics

-
-
- - updateBasics({ name: e.target.value })} - placeholder="GridPilot Sprint Series" - error={!!errors?.name} - errorMessage={errors?.name} - disabled={disabled} - /> -
- -
- -