|
1 | | -import { Stack } from '@chakra-ui/react'; |
| 1 | +import { Stack, StackProps, Text } from '@chakra-ui/react'; |
2 | 2 | import { QueryErrorResetBoundary } from '@tanstack/react-query'; |
3 | 3 | import { useRef } from 'react'; |
4 | 4 | import { ErrorBoundary } from 'react-error-boundary'; |
5 | 5 |
|
6 | 6 | import { useGlobalContext } from '../../../common/context/useGlobalContext'; |
7 | 7 | import { useUnresolvedIncidents } from '../../../common/queries/useUnresolvedIncidents'; |
8 | | -import { Flex, FlexProps } from '../../../ui/Flex'; |
9 | | -import { Text } from '../../../ui/Text'; |
10 | 8 | import { TextLink } from '../../../ui/TextLink'; |
11 | 9 | import { StatusBarBase } from './StatusBarBase'; |
12 | 10 | import { getColor } from './utils'; |
13 | 11 |
|
14 | | -function IncidentsStatusBar(props: FlexProps) { |
| 12 | +function IncidentsStatusBar(props: StackProps) { |
15 | 13 | const isTestnet = useGlobalContext().activeNetwork.mode === 'testnet'; |
16 | 14 | const { data: unresolvedIncidentsResponse, isFetching } = useUnresolvedIncidents(); |
17 | 15 | const incidents = unresolvedIncidentsResponse?.incidents; |
18 | 16 | const statusBarRef = useRef<HTMLDivElement | null>(null); |
19 | 17 |
|
20 | 18 | return ( |
21 | | - <Flex direction={'column'} {...props}> |
| 19 | + <Stack {...props}> |
22 | 20 | {incidents?.map(({ name, impact }) => { |
23 | 21 | const isTestnetUpdate = name.includes('Testnet Update:'); |
24 | 22 | if (isTestnetUpdate && !isTestnet) return null; |
25 | 23 | return ( |
26 | 24 | <StatusBarBase |
| 25 | + key={name} |
27 | 26 | ref={statusBarRef} |
28 | 27 | impact={impact} |
29 | 28 | content={ |
@@ -53,11 +52,11 @@ function IncidentsStatusBar(props: FlexProps) { |
53 | 52 | /> |
54 | 53 | ); |
55 | 54 | })} |
56 | | - </Flex> |
| 55 | + </Stack> |
57 | 56 | ); |
58 | 57 | } |
59 | 58 |
|
60 | | -export function IncidentsStatusBarWithErrorBoundary(props: FlexProps) { |
| 59 | +export function IncidentsStatusBarWithErrorBoundary(props: StackProps) { |
61 | 60 | return ( |
62 | 61 | <QueryErrorResetBoundary> |
63 | 62 | {({ reset }) => ( |
|
0 commit comments