Skip to content

Commit 5b25089

Browse files
committed
Clean up changes
1 parent 941f389 commit 5b25089

2 files changed

Lines changed: 12 additions & 38 deletions

File tree

next-frontend/src/components/live/ConnectionPulse.tsx

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,33 @@ import {
77
ConnectionState,
88
} from "@/lib/hooks/useResultsSubscription";
99
import { Tooltip } from "@/components/ui/tooltip";
10-
import { Badge, Box, Status, Text } from "@chakra-ui/react";
10+
import { Badge, Status, Text } from "@chakra-ui/react";
1111
import { useT } from "@/lib/i18n/useI18n";
1212

1313
export default function ConnectionPulse({
1414
connectionState,
1515
}: {
1616
connectionState: ConnectionState;
17-
animationDuration?: number;
1817
}) {
1918
const { t } = useT();
2019

21-
const connectionColor = CONNECTION_COLORS[connectionState];
22-
const mainLabel = t(
23-
`competitions.live.connection.status.${CONNECTION_TRANSLATION_KEYS[connectionState]}`,
24-
);
20+
const translationKey = CONNECTION_TRANSLATION_KEYS[connectionState];
21+
const isConnected = connectionState === CONNECTION_STATE_CONNECTED;
2522

2623
return (
27-
<Status.Root colorPalette={connectionColor} display="inline-flex">
24+
<Status.Root
25+
colorPalette={CONNECTION_COLORS[connectionState]}
26+
display="inline-flex"
27+
>
2828
<Tooltip
29-
content={t(
30-
`competitions.live.connection.${CONNECTION_TRANSLATION_KEYS[connectionState]}`,
31-
)}
29+
content={t(`competitions.live.connection.${translationKey}`)}
3230
showArrow
3331
openDelay={200}
3432
>
3533
<Badge variant="solid" display="inline-flex" gap={2} size="sm">
36-
<Box
37-
boxSize={{ base: "1.5", sm: "2" }}
38-
borderRadius="full"
39-
bg="colorPalette.contrast"
40-
animationName={
41-
connectionState === CONNECTION_STATE_CONNECTED
42-
? "pulse"
43-
: undefined
44-
}
45-
animationDuration="1.5s"
46-
animationTimingFunction="ease-in-out"
47-
animationIterationCount="infinite"
48-
animationDirection="alternate"
49-
/>
50-
<Text
51-
as="span"
52-
fontSize="inherit"
53-
fontWeight="medium"
54-
textTransform="uppercase"
55-
lineHeight="1"
56-
>
57-
{mainLabel}
34+
<Status.Indicator animation={isConnected ? "pulse" : undefined} />
35+
<Text>
36+
{t(`competitions.live.connection.status.${translationKey}`)}
5837
</Text>
5938
</Badge>
6039
</Tooltip>

next-frontend/src/components/live/LiveUpdatingResultsTable.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,7 @@ export default function LiveUpdatingResultsTable({
5656
return (
5757
<VStack align="left">
5858
<HStack>
59-
<Heading
60-
textStyle={{ sm: "h3", md: "h2", lg: "h1" }}
61-
textTransform="uppercase"
62-
>
63-
{title}
64-
</Heading>
59+
<Heading textStyle={{ sm: "h3", md: "h2", lg: "h1" }}>{title}</Heading>
6560
<Spacer flex={1} />
6661
<ConnectionPulse connectionState={connectionState} />
6762
{isLinkedRound && (

0 commit comments

Comments
 (0)