Skip to content

Commit a686b01

Browse files
committed
Convert showMore / showLess button
1 parent bcb5461 commit a686b01

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

src/components/TranslationLeaderboard.tsx

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,11 @@ const TranslationLeaderboard: React.FC<IProps> = ({
102102
updateFilterAmount(50)
103103
}
104104

105-
const { getRootProps, getRadioProps } = useRadioGroup({
106-
name: "framework",
105+
const { getRadioProps } = useRadioGroup({
106+
name: "period selection",
107107
defaultValue: "monthData",
108108
onChange: updateDateRangeType,
109109
})
110-
const group = getRootProps()
111110

112111
return (
113112
<Box>
@@ -264,17 +263,44 @@ const TranslationLeaderboard: React.FC<IProps> = ({
264263
flexDirection={{ base: "column", lg: "inherit" }}
265264
w="full"
266265
>
267-
<Option onClick={filterAmount === 10 ? showMore : showLess}>
268-
<OptionText fontSize={"18px"}>
266+
<Flex
267+
borderRadius="2rem"
268+
borderWidth="1px"
269+
borderStyle="solid"
270+
borderColor="text"
271+
color="text"
272+
alignItems="center"
273+
py={4}
274+
px={6}
275+
m={2}
276+
cursor="pointer"
277+
bg="transparent"
278+
w={{ base: "full", lg: "initial" }}
279+
justifyContent="center"
280+
ml={{ base: "0", lg: "2" }}
281+
mr={{ base: "0", lg: "2" }}
282+
_hover={{
283+
color: "primary",
284+
borderColor: "primary",
285+
}}
286+
onClick={filterAmount === 10 ? showMore : showLess}
287+
>
288+
<Text
289+
as="span"
290+
fontSize={{ base: "md", md: "lg" }}
291+
lineHeight="100%"
292+
textAlign="center"
293+
fontWeight={{ base: "semibold", md: "normal" }}
294+
>
269295
<Translation
270296
id={
271297
filterAmount === 10
272298
? "page-contributing-translation-program-acknowledgements-translation-leaderboard-show-more"
273299
: "page-contributing-translation-program-acknowledgements-translation-leaderboard-show-less"
274300
}
275301
/>
276-
</OptionText>
277-
</Option>
302+
</Text>
303+
</Flex>
278304
</Flex>
279305
</Box>
280306
)

0 commit comments

Comments
 (0)