1
1
import React , { ReactNode } from "react"
2
2
import { useRouter } from "next/router"
3
- import { Box , Text , VStack } from "@chakra-ui/react"
4
3
5
- import Heading from "@/components/Heading"
6
4
import InlineLink from "@/components/Link"
7
5
import Tooltip , { type TooltipProps } from "@/components/Tooltip"
8
6
import Translation from "@/components/Translation"
@@ -23,36 +21,36 @@ const GlossaryTooltip = ({
23
21
const { asPath } = useRouter ( )
24
22
25
23
return (
26
- < Box as = " span" display = "inline-block" >
24
+ < span className = "inline-block" >
27
25
< Tooltip
28
26
{ ...props }
29
27
content = {
30
- < VStack spacing = { 2 } align = " stretch" textAlign = " start">
31
- < Heading as = "h6" >
28
+ < div className = "flex flex-col items- stretch gap-2 text- start">
29
+ < h6 >
32
30
< Translation
33
31
id = { termKey + "-term" }
34
32
options = { { ns : "glossary-tooltip" } }
35
33
// Override the default `a` tag transformation to avoid circular
36
34
// dependency issues
37
35
transform = { { a : InlineLink } }
38
36
/>
39
- </ Heading >
37
+ </ h6 >
40
38
{ /**
41
39
* `as="span"` prevents hydration warnings for strings that contain
42
40
* elements that cannot be nested inside `p` tags, like `ul` tags
43
41
* (found in some Glossary definition).
44
42
* TODO: Develop a better solution to handle this case.
45
43
*/ }
46
- < Text as = " span" >
44
+ < span >
47
45
< Translation
48
46
id = { termKey + "-definition" }
49
47
options = { { ns : "glossary-tooltip" } }
50
48
// Override the default `a` tag transformation to avoid circular
51
49
// dependency issues
52
50
transform = { { a : InlineLink } }
53
51
/>
54
- </ Text >
55
- </ VStack >
52
+ </ span >
53
+ </ div >
56
54
}
57
55
onBeforeOpen = { ( ) => {
58
56
trackCustomEvent ( {
@@ -62,20 +60,11 @@ const GlossaryTooltip = ({
62
60
} )
63
61
} }
64
62
>
65
- < Text
66
- as = "u"
67
- textDecorationStyle = "dotted"
68
- textUnderlineOffset = "3px"
69
- _hover = { {
70
- textDecorationColor : "primary.hover" ,
71
- color : "primary.hover" ,
72
- } }
73
- cursor = "help"
74
- >
63
+ < u className = "cursor-help decoration-dotted underline-offset-3 hover:text-primary-hover hover:decoration-primary-hover" >
75
64
{ children }
76
- </ Text >
65
+ </ u >
77
66
</ Tooltip >
78
- </ Box >
67
+ </ span >
79
68
)
80
69
}
81
70
0 commit comments