Skip to content

Commit 2a96348

Browse files
committed
refactor(dataproductcard): add linkbox to dataproductcard
1 parent 36d3070 commit 2a96348

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

src/components/DataProductCard.tsx

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from "react"
22
import { StaticImageData } from "next/image"
3-
import { LinkBox, LinkOverlay } from "@chakra-ui/react"
43

54
import { TwImage } from "@/components/Image"
65
import { Flex } from "@/components/ui/flex"
76

8-
import useColorModeValue from "@/hooks/useColorModeValue"
7+
import InlineLink from "./ui/Link"
8+
import { LinkBox, LinkOverlay } from "./ui/link-box"
99

1010
export interface DataRow {
1111
logo: StaticImageData
@@ -34,26 +34,8 @@ const DataProductCard = ({
3434
description,
3535
data,
3636
}: DataProductCardProps) => {
37-
const boxShadow = useColorModeValue("tableBox.light", "tableBox.dark")
38-
3937
return (
40-
<LinkBox
41-
color="text"
42-
background="searchBackground"
43-
border="1px solid"
44-
borderColor="lightBorder"
45-
borderRadius="base"
46-
overflow="hidden"
47-
boxShadow={boxShadow}
48-
display="flex"
49-
flexDirection="column"
50-
_hover={{
51-
background: "tableBackgroundHover",
52-
boxShadow: boxShadow,
53-
transition: "transform 0.1s ease 0s",
54-
transform: "scale(1.02)",
55-
}}
56-
>
38+
<LinkBox className="flex flex-col overflow-hidden rounded border border-border shadow-table-box transition-transform duration-100 ease-linear hover:scale-[1.02] hover:bg-background-highlight focus:scale-[1.02] focus:bg-background-highlight">
5739
<Flex
5840
className={
5941
"min-h-[200px] items-center justify-center shadow-[rgb(0_0_0/_10%)_0px_-1px_0px_inset]"
@@ -70,8 +52,10 @@ const DataProductCard = ({
7052
<Flex className="flex-col justify-between text-left">
7153
<div>
7254
<h3 className="mx-4 my-8 mb-4 text-2xl font-semibold">
73-
<LinkOverlay href={url} isExternal>
74-
{name}
55+
<LinkOverlay asChild>
56+
<InlineLink href={url} hideArrow>
57+
{name}
58+
</InlineLink>
7559
</LinkOverlay>
7660
</h3>
7761
<p className="mx-4 mb-4 text-sm leading-[140%]">{description}</p>
@@ -81,8 +65,7 @@ const DataProductCard = ({
8165
{data.map(({ logo, coin, apy }, idx) => (
8266
<Flex
8367
key={idx}
84-
className="flex justify-between border border-x-0 border-border p-4 text-sm uppercase"
85-
// color="text300"
68+
className="justify-between border border-x-0 border-border p-4 text-sm uppercase"
8669
>
8770
<Flex className="items-center">
8871
{logo && (

0 commit comments

Comments
 (0)