@@ -5,10 +5,13 @@ import axios from "axios"
5
5
import { kebabCase } from "lodash"
6
6
import { AreaChart , ResponsiveContainer , Area , XAxis } from "recharts"
7
7
8
+ import { Grid , Icon } from "@chakra-ui/react"
9
+ import { MdInfoOutline } from "react-icons/md"
10
+
8
11
import Translation from "./Translation"
9
12
import Tooltip from "./Tooltip"
10
13
import Link from "./Link"
11
- import Icon from "./Icon"
14
+ // import Icon from "./Icon"
12
15
import StatErrorMessage from "./StatErrorMessage"
13
16
import StatLoadingMessage from "./StatLoadingMessage"
14
17
@@ -46,22 +49,6 @@ const Title = styled.p`
46
49
font-family: ${ ( props ) => props . theme . fonts . monospace } ;
47
50
`
48
51
49
- const Grid = styled . div `
50
- display: grid;
51
- grid-template-columns: repeat(2, 1fr);
52
- margin: 2rem 2rem 0;
53
- border-radius: 2px;
54
- @media (max-width: ${ ( { theme } ) => theme . breakpoints . l } ) {
55
- display: flex;
56
- flex-direction: column;
57
- width: 100%;
58
- margin: 2rem 0 0;
59
- }
60
- @media (max-width: ${ ( { theme } ) => theme . breakpoints . s } ) {
61
- margin: 0;
62
- }
63
- `
64
-
65
52
const Box = styled . div `
66
53
position: relative;
67
54
color: ${ ( { theme } ) => theme . colors . text } ;
@@ -87,17 +74,17 @@ const StatRow = styled.div`
87
74
flex-direction: column;
88
75
`
89
76
90
- const StyledIcon = styled ( Icon ) `
91
- fill: ${ ( { theme } ) => theme . colors . text } ;
92
- margin-right: 0.5rem;
93
- @media (max-width: ${ ( { theme } ) => theme . breakpoints . l } ) {
94
- }
95
- &:hover,
96
- &:active,
97
- &:focus {
98
- fill: ${ ( { theme } ) => theme . colors . primary } ;
99
- }
100
- `
77
+ // const StyledIcon = styled(Icon)`
78
+ // fill: ${({ theme }) => theme.colors.text };
79
+ // margin-right: 0.5rem;
80
+ // @media (max-width: ${({ theme }) => theme.breakpoints.l}) {
81
+ // }
82
+ // &:hover,
83
+ // &:active,
84
+ // &:focus {
85
+ // fill: ${({ theme }) => theme.colors.primary };
86
+ // }
87
+ // `
101
88
102
89
const Lines = styled . div `
103
90
position: absolute;
@@ -170,11 +157,19 @@ const GridItem: React.FC<IGridItemProps> = ({ metric, dir }) => {
170
157
) : isLoading ? (
171
158
< StatLoadingMessage />
172
159
) : (
160
+ // @TODO : Convert StatRow to Chakra
173
161
< StatRow >
174
162
< span >
175
163
{ state . value } { " " }
176
164
< Tooltip content = { tooltipContent ( metric ) } >
177
- < StyledIcon name = "info" />
165
+ { /* @TODO : continue migrate Icon
166
+
167
+ https://github.com/chakra-ui/chakra-ui/issues/363
168
+ */ }
169
+ < Icon
170
+ as = { MdInfoOutline }
171
+ sx = { { "svg:hover" : { fill : "text" } } }
172
+ > </ Icon >
178
173
</ Tooltip >
179
174
</ span >
180
175
</ StatRow >
@@ -563,7 +558,23 @@ const StatsBoxGrid: React.FC<IProps> = () => {
563
558
]
564
559
const dir = isLangRightToLeft ( intl . locale as Lang ) ? "rtl" : "ltr"
565
560
return (
566
- < Grid >
561
+ < Grid
562
+ display = { {
563
+ base : "flex" ,
564
+ lg : "grid" ,
565
+ } }
566
+ gridTemplateColumns = "repeat(2, 1fr)"
567
+ margin = { {
568
+ base : "0" ,
569
+ md : "2rem 0 0" ,
570
+ lg : "2rem 2rem 0" ,
571
+ } }
572
+ borderRadius = "2px"
573
+ flexDirection = { {
574
+ base : "column" ,
575
+ lg : "column" ,
576
+ } }
577
+ >
567
578
{ metrics . map ( ( metric , idx ) => (
568
579
< GridItem key = { idx } metric = { metric } dir = { dir } />
569
580
) ) }
0 commit comments