website refactor

This commit is contained in:
2026-01-15 18:52:03 +01:00
parent f035cfe7ce
commit 5ef149b782
39 changed files with 564 additions and 518 deletions

View File

@@ -50,10 +50,7 @@ export function LeagueRulebookTemplate({
const { scoringConfig } = viewData;
const primaryChampionship = scoringConfig.championships.find(c => c.type === 'driver') ?? scoringConfig.championships[0];
const positionPoints: { position: number; points: number }[] = primaryChampionship?.pointsPreview
.filter((p) => p.sessionType === primaryChampionship.sessionTypes[0])
.map(p => ({ position: p.position, points: p.points }))
.sort((a, b) => a.position - b.position) || [];
const positionPoints = viewData.positionPoints;
return (
<Stack gap={6}>
@@ -86,24 +83,24 @@ export function LeagueRulebookTemplate({
<Card>
<Stack gap={4}>
<Stack direction="row" align="center" gap={2}>
<Clock className="w-5 h-5 text-primary-blue" />
<Clock size={20} color="#3b82f6" />
<Heading level={2}>Weekend Structure & Timings</Heading>
</Stack>
<Grid cols={4} gap={4}>
<Surface variant="muted" rounded="lg" border padding={3}>
<Text size="xs" color="text-gray-500" block mb={1} style={{ textTransform: 'uppercase' }}>Practice</Text>
<Text size="xs" color="text-gray-500" block mb={1}>PRACTICE</Text>
<Text weight="medium" color="text-white">20 min</Text>
</Surface>
<Surface variant="muted" rounded="lg" border padding={3}>
<Text size="xs" color="text-gray-500" block mb={1} style={{ textTransform: 'uppercase' }}>Qualifying</Text>
<Text size="xs" color="text-gray-500" block mb={1}>QUALIFYING</Text>
<Text weight="medium" color="text-white">30 min</Text>
</Surface>
<Surface variant="muted" rounded="lg" border padding={3}>
<Text size="xs" color="text-gray-500" block mb={1} style={{ textTransform: 'uppercase' }}>Sprint</Text>
<Text size="xs" color="text-gray-500" block mb={1}>SPRINT</Text>
<Text weight="medium" color="text-white"></Text>
</Surface>
<Surface variant="muted" rounded="lg" border padding={3}>
<Text size="xs" color="text-gray-500" block mb={1} style={{ textTransform: 'uppercase' }}>Main Race</Text>
<Text size="xs" color="text-gray-500" block mb={1}>MAIN RACE</Text>
<Text weight="medium" color="text-white">40 min</Text>
</Surface>
</Grid>
@@ -128,7 +125,7 @@ export function LeagueRulebookTemplate({
padding={3}
>
<Stack direction="row" align="center" gap={4}>
<Surface variant="muted" rounded="full" padding={1} style={{ width: '2rem', height: '2rem', backgroundColor: 'rgba(16, 185, 129, 0.1)', border: '1px solid rgba(16, 185, 129, 0.2)', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Surface variant="muted" rounded="full" padding={1} w="2rem" h="2rem" bg="bg-green-500/10" borderColor="border-green-500/20" display="flex" alignItems="center" justifyContent="center">
<Text color="text-performance-green" weight="bold">+</Text>
</Surface>
<Text size="sm" color="text-gray-300">{bonus}</Text>
@@ -222,9 +219,9 @@ export function LeagueRulebookTemplate({
function StatItem({ label, value }: { label: string, value: string | number }) {
return (
<Surface variant="muted" rounded="lg" border padding={4} style={{ backgroundColor: '#262626', borderColor: '#262626' }}>
<Text size="xs" color="text-gray-500" style={{ textTransform: 'uppercase', letterSpacing: '0.05em' }} block mb={1}>{label}</Text>
<Text weight="semibold" color="text-white" style={{ fontSize: '1.125rem' }}>{value}</Text>
<Surface variant="muted" rounded="lg" border padding={4} bg="bg-neutral-800" borderColor="border-neutral-800">
<Text size="xs" color="text-gray-500" block mb={1}>{label.toUpperCase()}</Text>
<Text weight="semibold" color="text-white" size="lg">{value}</Text>
</Surface>
);
}
@@ -245,7 +242,7 @@ function PenaltyRow({ infraction, penalty, color }: { infraction: string, penalt
<Text size="sm" color="text-gray-300">{infraction}</Text>
</TableCell>
<TableCell>
<Text size="sm" style={{ color: color || '#f59e0b' }}>{penalty}</Text>
<Text size="sm" color={color === '#f87171' ? 'text-error-red' : 'text-warning-amber'}>{penalty}</Text>
</TableCell>
</TableRow>
);