website cleanup
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { Trophy, Users, Check, HelpCircle, X } from 'lucide-react';
|
||||
import { useState, useRef, useEffect } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import type { LeagueConfigFormModel } from '@core/racing/application';
|
||||
import type { LeagueConfigFormModel } from '@/lib/types/LeagueConfigFormModel';
|
||||
|
||||
// Minimum drivers for ranked leagues
|
||||
const MIN_RANKED_DRIVERS = 10;
|
||||
@@ -132,14 +132,14 @@ export function LeagueVisibilitySection({
|
||||
const unrankedInfoRef = useRef<HTMLButtonElement>(null);
|
||||
|
||||
// Normalize visibility to new terminology
|
||||
const isRanked = basics.visibility === 'ranked' || basics.visibility === 'public';
|
||||
const isRanked = basics.visibility === 'public';
|
||||
|
||||
// Auto-update minDrivers when switching to ranked
|
||||
const handleVisibilityChange = (visibility: 'ranked' | 'unranked') => {
|
||||
const handleVisibilityChange = (visibility: 'public' | 'private' | 'unlisted') => {
|
||||
if (!onChange) return;
|
||||
|
||||
// If switching to ranked and current maxDrivers is below minimum, update it
|
||||
if (visibility === 'ranked' && form.structure.maxDrivers < MIN_RANKED_DRIVERS) {
|
||||
// If switching to public and current maxDrivers is below minimum, update it
|
||||
if (visibility === 'public' && (form.structure?.maxDrivers ?? 0) < MIN_RANKED_DRIVERS) {
|
||||
onChange({
|
||||
...form,
|
||||
basics: { ...form.basics, visibility },
|
||||
@@ -172,7 +172,7 @@ export function LeagueVisibilitySection({
|
||||
<button
|
||||
type="button"
|
||||
disabled={disabled}
|
||||
onClick={() => handleVisibilityChange('ranked')}
|
||||
onClick={() => handleVisibilityChange('public')}
|
||||
className={`w-full group relative flex flex-col gap-4 p-6 text-left rounded-xl border-2 transition-all duration-200 ${
|
||||
isRanked
|
||||
? 'border-primary-blue bg-gradient-to-br from-primary-blue/15 to-primary-blue/5 shadow-[0_0_30px_rgba(25,140,255,0.25)]'
|
||||
@@ -293,7 +293,7 @@ export function LeagueVisibilitySection({
|
||||
<button
|
||||
type="button"
|
||||
disabled={disabled}
|
||||
onClick={() => handleVisibilityChange('unranked')}
|
||||
onClick={() => handleVisibilityChange('private')}
|
||||
className={`w-full group relative flex flex-col gap-4 p-6 text-left rounded-xl border-2 transition-all duration-200 ${
|
||||
!isRanked
|
||||
? 'border-neon-aqua bg-gradient-to-br from-neon-aqua/15 to-neon-aqua/5 shadow-[0_0_30px_rgba(67,201,230,0.2)]'
|
||||
|
||||
Reference in New Issue
Block a user