@@ -9,24 +9,6 @@ import { Option, OptionContainer, OptionText } from "./SharedStyledComponents"
9
9
import Translation from "./Translation"
10
10
import { Box , Flex , useColorModeValue } from "@chakra-ui/react"
11
11
12
- const Item = styled . div `
13
- text-decoration: none;
14
- display: flex;
15
- justify-content: space-between;
16
- align-items: center;
17
- color: ${ ( props ) => props . theme . colors . text } !important;
18
- box-shadow: 0 1px 1px ${ ( props ) => props . theme . colors . tableItemBoxShadow } ;
19
- margin-bottom: 1px;
20
- padding: 0.5rem 1rem;
21
- width: 100%;
22
- color: #000000;
23
- &:hover {
24
- border-radius: 4px;
25
- box-shadow: 0 0 1px ${ ( props ) => props . theme . colors . primary } ;
26
- background: ${ ( props ) => props . theme . colors . tableBackgroundHover } ;
27
- }
28
- `
29
-
30
12
const TextContainer = styled . div `
31
13
display: flex;
32
14
flex-direction: row;
@@ -96,7 +78,11 @@ const TranslationLeaderboard: React.FC<IProps> = ({
96
78
quarterData,
97
79
allTimeData,
98
80
} ) => {
99
- const shadow = useColorModeValue ( "tableBox.light" , "tableBox.dark" )
81
+ const tableBoxShadow = useColorModeValue ( "tableBox.light" , "tableBox.dark" )
82
+ const tableItemBoxShadow = useColorModeValue (
83
+ "tableItemBox.light" ,
84
+ "tableItemBox.dark"
85
+ )
100
86
const leaderboardData = {
101
87
monthData : reverse ( sortBy ( monthData . data , ( { user } ) => user . totalCosts ) ) ,
102
88
quarterData : reverse (
@@ -145,7 +131,7 @@ const TranslationLeaderboard: React.FC<IProps> = ({
145
131
</ OptionText >
146
132
</ Option >
147
133
</ OptionContainer >
148
- < Box bg = "background" boxShadow = { shadow } w = "full" mb = { 8 } >
134
+ < Box bg = "background" boxShadow = { tableBoxShadow } w = "full" mb = { 8 } >
149
135
< Flex
150
136
bg = "grayBackground"
151
137
textDecoration = "none"
@@ -197,7 +183,23 @@ const TranslationLeaderboard: React.FC<IProps> = ({
197
183
emoji = ":3rd_place_medal:"
198
184
}
199
185
return (
200
- < Item key = { idx } >
186
+ < Flex
187
+ textDecoration = "none"
188
+ justifyContent = "space-between"
189
+ alignItems = "center"
190
+ color = "text"
191
+ boxShadow = { tableItemBoxShadow }
192
+ mb = "px"
193
+ py = { 2 }
194
+ px = { 4 }
195
+ w = "full"
196
+ _hover = { {
197
+ borderRadius : "base" ,
198
+ boxShadow : "tableItemBoxHover" ,
199
+ bg : "tableBackgroundHover" ,
200
+ } }
201
+ key = { idx }
202
+ >
201
203
< Flex >
202
204
{ emoji ? (
203
205
< Width40 >
@@ -218,7 +220,7 @@ const TranslationLeaderboard: React.FC<IProps> = ({
218
220
< StyledEmoji mr = { "0.5rem" } size = { 1.5 } text = { ":writing:" } />
219
221
{ user . totalCosts }
220
222
</ WordsContainer >
221
- </ Item >
223
+ </ Flex >
222
224
)
223
225
} ) }
224
226
</ Box >
0 commit comments