Skip to content

Commit ab13d66

Browse files
committed
Convert TextContainer and WordsContainer
1 parent aa81284 commit ab13d66

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

src/components/TranslationLeaderboard.tsx

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,6 @@ import { Option, OptionContainer, OptionText } from "./SharedStyledComponents"
99
import Translation from "./Translation"
1010
import { Box, Flex, useColorModeValue } from "@chakra-ui/react"
1111

12-
const TextContainer = styled.div`
13-
display: flex;
14-
flex-direction: row;
15-
align-items: center;
16-
margin-right: 2rem;
17-
overflow-wrap: anywhere;
18-
`
19-
20-
const WordsContainer = styled.div`
21-
min-width: 20%;
22-
display: flex;
23-
flex-direction: row;
24-
align-items: left;
25-
`
26-
2712
const Avatar = styled.img`
2813
margin-right: 1rem;
2914
height: 40px;
@@ -144,13 +129,18 @@ const TranslationLeaderboard: React.FC<IProps> = ({
144129
>
145130
<Flex>
146131
<ItemNumber>#</ItemNumber>
147-
<TextContainer>
132+
<Flex
133+
flexDirection="row"
134+
alignItems="center"
135+
mr={8}
136+
overflowWrap="anywhere"
137+
>
148138
<Translation id="page-contributing-translation-program-acknowledgements-translator" />
149-
</TextContainer>
139+
</Flex>
150140
</Flex>
151-
<WordsContainer>
141+
<Flex minW="20%" flexDirection="row" alignItems="left">
152142
<Translation id="page-contributing-translation-program-acknowledgements-total-words" />
153-
</WordsContainer>
143+
</Flex>
154144
</Flex>
155145
{/* // TODO: Remove specific user checks once Acolad has updated their usernames */}
156146
{leaderboardData[dateRangeType]
@@ -208,18 +198,23 @@ const TranslationLeaderboard: React.FC<IProps> = ({
208198
) : (
209199
<ItemNumber>{idx + 1}</ItemNumber>
210200
)}
211-
<TextContainer>
201+
<Flex
202+
flexDirection="row"
203+
alignItems="center"
204+
mr={8}
205+
overflowWrap="anywhere"
206+
>
212207
<Avatar src={user.avatarUrl} />
213208
<NameContainer>
214209
{user.username}
215210
<Language>{sortedLanguages[0].language.name}</Language>
216211
</NameContainer>
217-
</TextContainer>
212+
</Flex>
218213
</Flex>
219-
<WordsContainer>
214+
<Flex minW="20%" flexDirection="row" alignItems="left">
220215
<StyledEmoji mr={"0.5rem"} size={1.5} text={":writing:"} />
221216
{user.totalCosts}
222-
</WordsContainer>
217+
</Flex>
223218
</Flex>
224219
)
225220
})}

0 commit comments

Comments
 (0)