website refactor
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Box } from '@/ui/Box';
|
||||
import { Image } from '@/ui/Image';
|
||||
import { Stack } from '@/ui/Stack';
|
||||
import { Image } from '@/ui/Image';
|
||||
import { Text } from '@/ui/Text';
|
||||
import { RatingDisplay } from '@/lib/display-objects/RatingDisplay';
|
||||
import { MedalDisplay } from '@/lib/display-objects/MedalDisplay';
|
||||
@@ -25,11 +24,11 @@ export function LeaderboardPodium({ podium, onDriverClick }: LeaderboardPodiumPr
|
||||
const displayOrder = [1, 0, 2];
|
||||
|
||||
return (
|
||||
<Box mb={12}>
|
||||
<Box display="flex" alignItems="end" justifyContent="center" gap={4} maxWidth="4xl" mx="auto">
|
||||
<Stack mb={12}>
|
||||
<Stack display="flex" alignItems="end" justifyContent="center" gap={4} maxWidth="4xl" mx="auto">
|
||||
{displayOrder.map((index) => {
|
||||
const driver = podium[index];
|
||||
if (!driver) return <Box key={index} flexGrow={1} />;
|
||||
if (!driver) return <Stack key={index} flexGrow={1} />;
|
||||
|
||||
const position = index + 1;
|
||||
const isFirst = position === 1;
|
||||
@@ -41,7 +40,7 @@ export function LeaderboardPodium({ podium, onDriverClick }: LeaderboardPodiumPr
|
||||
}[position as 1 | 2 | 3];
|
||||
|
||||
return (
|
||||
<Box
|
||||
<Stack
|
||||
key={driver.id}
|
||||
as="button"
|
||||
type="button"
|
||||
@@ -56,8 +55,8 @@ export function LeaderboardPodium({ podium, onDriverClick }: LeaderboardPodiumPr
|
||||
shadow={config.shadow}
|
||||
zIndex={config.zIndex}
|
||||
>
|
||||
<Box position="relative" mb={4} transform={`scale(${config.scale})`}>
|
||||
<Box
|
||||
<Stack position="relative" mb={4} transform={`scale(${config.scale})`}>
|
||||
<Stack
|
||||
position="relative"
|
||||
w={isFirst ? '32' : '24'}
|
||||
h={isFirst ? '32' : '24'}
|
||||
@@ -79,8 +78,8 @@ export function LeaderboardPodium({ podium, onDriverClick }: LeaderboardPodiumPr
|
||||
fullHeight
|
||||
objectFit="cover"
|
||||
/>
|
||||
</Box>
|
||||
<Box
|
||||
</Stack>
|
||||
<Stack
|
||||
position="absolute"
|
||||
bottom="-2"
|
||||
left="50%"
|
||||
@@ -98,8 +97,8 @@ export function LeaderboardPodium({ podium, onDriverClick }: LeaderboardPodiumPr
|
||||
shadow="lg"
|
||||
>
|
||||
<Text size="sm" weight="bold">{position}</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<Text
|
||||
weight="bold"
|
||||
@@ -132,14 +131,14 @@ export function LeaderboardPodium({ podium, onDriverClick }: LeaderboardPodiumPr
|
||||
<Text size="xs" color="text-gray-500" weight="bold" uppercase letterSpacing="wider">Wins</Text>
|
||||
<Text size="xs" weight="bold" color="text-performance-green">{driver.wins}</Text>
|
||||
</Stack>
|
||||
<Box w="1" h="1" rounded="full" bg="bg-gray-700" />
|
||||
<Stack w="1" h="1" rounded="full" bg="bg-gray-700" />
|
||||
<Stack direction="row" align="center" gap={1}>
|
||||
<Text size="xs" color="text-gray-500" weight="bold" uppercase letterSpacing="wider">Podiums</Text>
|
||||
<Text size="xs" weight="bold" color="text-white">{driver.podiums}</Text>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<Box
|
||||
<Stack
|
||||
mt={6}
|
||||
w="full"
|
||||
h={config.height}
|
||||
@@ -163,11 +162,11 @@ export function LeaderboardPodium({ podium, onDriverClick }: LeaderboardPodiumPr
|
||||
>
|
||||
{position}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
})}
|
||||
</Box>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user