@@ -3,6 +3,7 @@ import React, { useState } from "react"
3
3
import { reverse , sortBy } from "lodash"
4
4
import {
5
5
Box ,
6
+ Button as ChakraButton ,
6
7
Flex ,
7
8
Img ,
8
9
Text ,
@@ -21,17 +22,10 @@ export interface IProps {
21
22
allTimeData : any
22
23
}
23
24
24
- const RadioCard = ( props ) => {
25
- const shadow = useColorModeValue ( "tableBox.light" , "tableBox.dark" )
26
- const { getInputProps, getCheckboxProps } = useRadio ( props )
27
-
28
- const input = getInputProps ( )
29
- const checkbox = getCheckboxProps ( )
30
-
25
+ const Button = ( props ) => {
31
26
return (
32
- < Flex
33
- as = "label"
34
- { ...checkbox }
27
+ < ChakraButton
28
+ display = "flex"
35
29
borderRadius = "2rem"
36
30
borderWidth = "1px"
37
31
borderStyle = "solid"
@@ -41,6 +35,7 @@ const RadioCard = (props) => {
41
35
py = { 4 }
42
36
px = { 6 }
43
37
m = { 2 }
38
+ h = "full"
44
39
cursor = "pointer"
45
40
bg = "transparent"
46
41
w = { { base : "full" , lg : "initial" } }
@@ -51,6 +46,22 @@ const RadioCard = (props) => {
51
46
color : "primary" ,
52
47
borderColor : "primary" ,
53
48
} }
49
+ { ...props }
50
+ />
51
+ )
52
+ }
53
+
54
+ const RadioCard = ( props ) => {
55
+ const shadow = useColorModeValue ( "tableBox.light" , "tableBox.dark" )
56
+ const { getInputProps, getCheckboxProps } = useRadio ( props )
57
+
58
+ const input = getInputProps ( )
59
+ const checkbox = getCheckboxProps ( )
60
+
61
+ return (
62
+ < Button
63
+ as = "label"
64
+ { ...checkbox }
54
65
_checked = { {
55
66
borderColor : "primary" ,
56
67
color : "primary" ,
@@ -67,7 +78,7 @@ const RadioCard = (props) => {
67
78
>
68
79
{ props . children }
69
80
</ Text >
70
- </ Flex >
81
+ </ Button >
71
82
)
72
83
}
73
84
@@ -262,28 +273,7 @@ const TranslationLeaderboard: React.FC<IProps> = ({
262
273
flexDirection = { { base : "column" , lg : "inherit" } }
263
274
w = "full"
264
275
>
265
- < Flex
266
- borderRadius = "2rem"
267
- borderWidth = "1px"
268
- borderStyle = "solid"
269
- borderColor = "text"
270
- color = "text"
271
- alignItems = "center"
272
- py = { 4 }
273
- px = { 6 }
274
- m = { 2 }
275
- cursor = "pointer"
276
- bg = "transparent"
277
- w = { { base : "full" , lg : "initial" } }
278
- justifyContent = "center"
279
- ml = { { base : "0" , lg : "2" } }
280
- mr = { { base : "0" , lg : "2" } }
281
- _hover = { {
282
- color : "primary" ,
283
- borderColor : "primary" ,
284
- } }
285
- onClick = { filterAmount === 10 ? showMore : showLess }
286
- >
276
+ < Button onClick = { filterAmount === 10 ? showMore : showLess } >
287
277
< Text
288
278
as = "span"
289
279
fontSize = { { base : "md" , md : "lg" } }
@@ -299,7 +289,7 @@ const TranslationLeaderboard: React.FC<IProps> = ({
299
289
}
300
290
/>
301
291
</ Text >
302
- </ Flex >
292
+ </ Button >
303
293
</ Flex >
304
294
</ Box >
305
295
)
0 commit comments