1
1
import React from "react"
2
- import { Icon , Box , Text , Flex , LinkBox , LinkOverlay } from "@chakra-ui/react"
2
+ import {
3
+ Icon ,
4
+ Box ,
5
+ Text ,
6
+ Flex ,
7
+ LinkBox ,
8
+ LinkOverlay ,
9
+ useToken ,
10
+ } from "@chakra-ui/react"
3
11
import { AiOutlineArrowRight } from "react-icons/ai"
4
12
import Emoji from "./Emoji"
5
13
import Link from "./Link"
@@ -11,62 +19,60 @@ export interface IProps {
11
19
}
12
20
13
21
const DocLink : React . FC < IProps > = ( { to, children, isExternal = false } ) => {
22
+ const linkBoxShadowColor = useToken ( "colors" , "primary" )
23
+
14
24
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"
25
+ < LinkBox
26
+ padding = { 4 }
27
+ borderRadius = "sm"
28
+ color = "text"
29
+ border = "1px"
30
+ borderStyle = "solid"
31
+ borderColor = "border"
32
+ _hover = { {
33
+ background : "tableBackgroundHover" ,
34
+ borderRadius : "base" ,
35
+ boxShadow : `0 0 1px ${ linkBoxShadowColor } ` ,
36
+ } }
37
+ >
38
+ < Flex
39
+ zIndex = { 1 }
40
+ display = "flex"
41
+ flexDirection = "row"
42
+ flex = { 1 }
43
+ justifyContent = "space-between"
29
44
>
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
- />
45
+ < Flex align = "center" >
46
+ < Emoji fontSize = "md" mr = { 4 } text = ":page_with_curl:" />
68
47
</ Flex >
69
- </ Box >
48
+ < Box flex = { 1 } flexDirection = "column" >
49
+ < LinkOverlay
50
+ href = { to }
51
+ as = { Link }
52
+ isExternal = { isExternal }
53
+ textDecoration = "none"
54
+ _hover = { { textDecoration : "none" } }
55
+ hideArrow
56
+ >
57
+ < Text color = "text300" fontWeight = "semibold" margin = { 0 } >
58
+ { children }
59
+ </ Text >
60
+ </ LinkOverlay >
61
+ </ Box >
62
+ < Icon
63
+ as = { AiOutlineArrowRight }
64
+ alignSelf = "center"
65
+ minWidth = { 8 }
66
+ boxSize = { 6 }
67
+ marginX = { 6 }
68
+ _groupHover = { {
69
+ fill : "primary" ,
70
+ transition : "transform 0.1s" ,
71
+ transform : "scale(1.2)" ,
72
+ rotate : isExternal ? "-45deg" : "0" ,
73
+ } }
74
+ />
75
+ </ Flex >
70
76
</ LinkBox >
71
77
)
72
78
}
0 commit comments