Skip to content

Commit 77c59f8

Browse files
committed
Convert Avatar and NameContainer to Chakra
1 parent ab13d66 commit 77c59f8

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

src/components/TranslationLeaderboard.tsx

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,7 @@ import { reverse, sortBy } from "lodash"
77
import Emoji from "./OldEmoji"
88
import { Option, OptionContainer, OptionText } from "./SharedStyledComponents"
99
import Translation from "./Translation"
10-
import { Box, Flex, useColorModeValue } from "@chakra-ui/react"
11-
12-
const Avatar = styled.img`
13-
margin-right: 1rem;
14-
height: 40px;
15-
width: 40px;
16-
@media (max-width: ${(props) => props.theme.breakpoints.s}) {
17-
height: 30px;
18-
width: 30px;
19-
}
20-
border-radius: 50%;
21-
@media (max-width: ${(props) => props.theme.breakpoints.xs}) {
22-
display: none;
23-
}
24-
`
25-
26-
const NameContainer = styled.div`
27-
@media (max-width: ${(props) => props.theme.breakpoints.s}) {
28-
max-width: 100px;
29-
}
30-
`
10+
import { Box, Flex, Img, useColorModeValue } from "@chakra-ui/react"
3111

3212
const Width40 = styled.div`
3313
width: 40px;
@@ -204,11 +184,18 @@ const TranslationLeaderboard: React.FC<IProps> = ({
204184
mr={8}
205185
overflowWrap="anywhere"
206186
>
207-
<Avatar src={user.avatarUrl} />
208-
<NameContainer>
187+
<Img
188+
mr={4}
189+
h={{ base: "30px", sm: 10 }}
190+
w={{ base: "30px", sm: 10 }}
191+
borderRadius="50%"
192+
display={{ base: "none", sm: "block" }}
193+
src={user.avatarUrl}
194+
/>
195+
<Box maxW={{ base: "100px", sm: "none" }}>
209196
{user.username}
210197
<Language>{sortedLanguages[0].language.name}</Language>
211-
</NameContainer>
198+
</Box>
212199
</Flex>
213200
</Flex>
214201
<Flex minW="20%" flexDirection="row" alignItems="left">

0 commit comments

Comments
 (0)