Skip to content

Commit 428ea41

Browse files
refactor(doc-link): send wrapping Box style props to LinkBox
1 parent 94dfbce commit 428ea41

File tree

1 file changed

+50
-53
lines changed

1 file changed

+50
-53
lines changed

src/components/DocLink.tsx

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -12,61 +12,58 @@ export interface IProps {
1212

1313
const DocLink: React.FC<IProps> = ({ to, children, isExternal = false }) => {
1414
return (
15-
<LinkBox>
16-
<Box
17-
padding={4}
18-
borderRadius="sm"
19-
color="text"
20-
border="1px"
21-
borderStyle="solid"
22-
borderColor="border"
23-
_hover={{
24-
background: "tableBackgroundHover",
25-
borderRadius: "base",
26-
boxShadow: "0 0 1px var(--eth-colors-primary)",
27-
}}
28-
role="group"
15+
<LinkBox
16+
padding={4}
17+
borderRadius="sm"
18+
color="text"
19+
border="1px"
20+
borderStyle="solid"
21+
borderColor="border"
22+
_hover={{
23+
background: "tableBackgroundHover",
24+
borderRadius: "base",
25+
boxShadow: "0 0 1px var(--eth-colors-primary)",
26+
}}
27+
>
28+
<Flex
29+
position="relative"
30+
zIndex={1}
31+
display="flex"
32+
flexDirection="row"
33+
flex={1}
34+
justifyContent="space-between"
2935
>
30-
<Flex
31-
position="relative"
32-
zIndex={1}
33-
display="flex"
34-
flexDirection="row"
35-
flex={1}
36-
justifyContent="space-between"
37-
>
38-
<Flex align="center">
39-
<Emoji fontSize="md" mr={4} text=":page_with_curl:" />
40-
</Flex>
41-
<Box flex={1} flexDirection="column">
42-
<LinkOverlay
43-
href={to}
44-
as={Link}
45-
isExternal={isExternal}
46-
textDecoration="none"
47-
_hover={{ textDecoration: "none" }}
48-
hideArrow
49-
>
50-
<Text color="text300" fontWeight="semibold" margin={0}>
51-
{children}
52-
</Text>
53-
</LinkOverlay>
54-
</Box>
55-
<Icon
56-
as={AiOutlineArrowRight}
57-
alignSelf="center"
58-
minWidth="2rem"
59-
boxSize={6}
60-
marginX={6}
61-
_groupHover={{
62-
fill: "primary",
63-
transition: "transform 0.1s",
64-
transform: "scale(1.2)",
65-
rotate: isExternal ? "-45deg" : "0",
66-
}}
67-
/>
36+
<Flex align="center">
37+
<Emoji fontSize="md" mr={4} text=":page_with_curl:" />
6838
</Flex>
69-
</Box>
39+
<Box flex={1} flexDirection="column">
40+
<LinkOverlay
41+
href={to}
42+
as={Link}
43+
isExternal={isExternal}
44+
textDecoration="none"
45+
_hover={{ textDecoration: "none" }}
46+
hideArrow
47+
>
48+
<Text color="text300" fontWeight="semibold" margin={0}>
49+
{children}
50+
</Text>
51+
</LinkOverlay>
52+
</Box>
53+
<Icon
54+
as={AiOutlineArrowRight}
55+
alignSelf="center"
56+
minWidth="2rem"
57+
boxSize={6}
58+
marginX={6}
59+
_groupHover={{
60+
fill: "primary",
61+
transition: "transform 0.1s",
62+
transform: "scale(1.2)",
63+
rotate: isExternal ? "-45deg" : "0",
64+
}}
65+
/>
66+
</Flex>
7067
</LinkBox>
7168
)
7269
}

0 commit comments

Comments
 (0)