Skip to content

Commit e07eae2

Browse files
committed
chore: add LinkBox & LinkOverlay
1 parent d13393e commit e07eae2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/components/DocLink.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AiOutlineArrowRight } from "react-icons/ai"
33
import { cn } from "@/lib/utils/cn"
44

55
import { Center, Flex, Stack } from "./ui/flex"
6-
import { BaseLink } from "./ui/Link"
6+
import { LinkBox, LinkOverlay } from "./ui/link-box"
77
import Emoji from "./Emoji"
88

99
import { useRtlFlip } from "@/hooks/useRtlFlip"
@@ -18,22 +18,24 @@ const DocLink = ({ href, children, isExternal = false }: DocLinkProps) => {
1818
const { isRtl } = useRtlFlip()
1919

2020
return (
21-
<BaseLink
21+
<LinkBox
2222
className={cn(
2323
"flex rounded-sm border p-4 text-current no-underline",
2424
"hover:rounded hover:bg-background-highlight hover:no-underline",
2525
"group hover:shadow-[0_0_1px] hover:shadow-primary"
2626
)}
27-
href={href}
2827
>
2928
<Flex className="flex-1 justify-between">
3029
<Center>
3130
<Emoji className="me-4 text-md" text=":page_with_curl:" />
3231
</Center>
3332
<Stack className="flex-1">
34-
<p className="font-semibold text-[#4c4c4c] dark:text-[#cccccc]">
35-
{children}
36-
</p>
33+
<LinkOverlay href={href} className="no-underline">
34+
{" "}
35+
<p className="font-semibold text-[#4c4c4c] dark:text-[#cccccc]">
36+
{children}
37+
</p>
38+
</LinkOverlay>
3739
</Stack>
3840

3941
<AiOutlineArrowRight
@@ -46,7 +48,7 @@ const DocLink = ({ href, children, isExternal = false }: DocLinkProps) => {
4648
)}
4749
/>
4850
</Flex>
49-
</BaseLink>
51+
</LinkBox>
5052
)
5153
}
5254

0 commit comments

Comments
 (0)