1
1
// Import libraries
2
2
import React , { useState , useEffect , ReactNode } from "react"
3
3
import { useIntl } from "react-intl"
4
- import { Code , Flex , Icon , Spinner } from "@chakra-ui/react"
4
+ import {
5
+ Code ,
6
+ Divider ,
7
+ Flex ,
8
+ Icon ,
9
+ Spinner ,
10
+ useBreakpointValue ,
11
+ VStack ,
12
+ } from "@chakra-ui/react"
5
13
// Import components
6
14
import Translation from "../Translation"
7
15
import Tooltip from "../Tooltip"
@@ -19,26 +27,21 @@ const MAX_EFFECTIVE_BALANCE = 32
19
27
20
28
const Cell : React . FC < { children : ReactNode } > = ( { children } ) => {
21
29
return (
22
- < Flex
23
- direction = "column"
24
- alignItems = "center"
25
- py = { 4 }
26
- px = { 8 }
27
- borderLeft = { { base : "none" , md : "1px solid" } }
28
- borderLeftColor = { { md : "preBorder" } }
29
- borderTop = { { base : "1px solid #33333355" , md : "none" } }
30
- sx = { {
31
- "&:first-child" : {
32
- borderLeft : "none" ,
33
- borderTop : "none" ,
34
- } ,
35
- } }
36
- >
30
+ < VStack spacing = { 2 } py = { 4 } px = { 8 } >
37
31
{ children }
38
- </ Flex >
32
+ </ VStack >
39
33
)
40
34
}
41
35
36
+ const CellDivider = ( ) => {
37
+ // Hook needed because the `orientation` prop does not directly accept responsive values
38
+ const orientation = useBreakpointValue < "horizontal" | "vertical" > ( {
39
+ base : "horizontal" ,
40
+ md : "vertical" ,
41
+ } )
42
+ return < Divider borderColor = "preBorder" orientation = { orientation } />
43
+ }
44
+
42
45
const Value : React . FC < { children : ReactNode ; title : string } > = ( {
43
46
children,
44
47
title,
@@ -49,10 +52,6 @@ const Value: React.FC<{ children: ReactNode; title: string }> = ({
49
52
fontWeight = "bold"
50
53
fontSize = "2rem"
51
54
background = "none"
52
- display = "flex"
53
- alignItems = "center"
54
- textAlign = "center"
55
- textTransform = "uppercase"
56
55
color = "primary"
57
56
>
58
57
{ children }
@@ -62,13 +61,7 @@ const Value: React.FC<{ children: ReactNode; title: string }> = ({
62
61
63
62
const Label : React . FC < { children : ReactNode } > = ( { children } ) => {
64
63
return (
65
- < Flex
66
- wrap = "nowrap"
67
- alignItems = "center"
68
- textTransform = "uppercase"
69
- fontSize = "sm"
70
- mt = { 2 }
71
- >
64
+ < Flex alignItems = "center" textTransform = "uppercase" fontSize = "sm" >
72
65
{ children }
73
66
</ Flex >
74
67
)
@@ -168,6 +161,7 @@ const StakingStatsBox: React.FC<IProps> = () => {
168
161
< BeaconchainTooltip />
169
162
</ Label >
170
163
</ Cell >
164
+ < CellDivider />
171
165
< Cell >
172
166
{ totalValidators === ZERO ? (
173
167
< Spinner />
@@ -181,6 +175,7 @@ const StakingStatsBox: React.FC<IProps> = () => {
181
175
< BeaconchainTooltip />
182
176
</ Label >
183
177
</ Cell >
178
+ < CellDivider />
184
179
< Cell >
185
180
{ currentApr === ZERO ? (
186
181
< Spinner />
0 commit comments