Skip to content

Commit b0faf55

Browse files
committed
fix: use cn function and remove useColorModeValue
1 parent 0d632ff commit b0faf55

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/components/ActionCard.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { StaticImageData } from "next/image"
22
import type { BaseHTMLAttributes, ElementType, ReactNode } from "react"
3-
import { useColorModeValue } from "@chakra-ui/react"
43

54
import { TwImage } from "@/components/Image"
65
import InlineLink from "@/components/ui/Link"
76
import { LinkBox, LinkOverlay } from "@/components/ui/link-box"
87

8+
import { cn } from "@/lib/utils/cn"
9+
910
import { Flex } from "./ui/flex"
1011
export type ActionCardProps = Omit<
1112
BaseHTMLAttributes<HTMLDivElement>,
@@ -37,18 +38,20 @@ const ActionCard = ({
3738
isBottom = true,
3839
...props
3940
}: ActionCardProps) => {
40-
const descriptionColor = useColorModeValue(
41-
"text-black opacity-65",
42-
"text-white opacity-80"
43-
)
44-
4541
return (
4642
<LinkBox
47-
className={`focus:bg-table-bg-hover m-4 flex flex-none shadow-table hover:scale-[1.02] hover:rounded hover:bg-background-highlight hover:shadow-table-box-hover hover:duration-100 focus:scale-[1.02] focus:rounded focus:shadow-table-box-hover focus:duration-100 ${className}`}
43+
className={cn(
44+
"focus:bg-table-bg-hover m-4 flex flex-none shadow-table hover:scale-[1.02] hover:rounded hover:bg-background-highlight hover:shadow-table-box-hover hover:duration-100 focus:scale-[1.02] focus:rounded focus:shadow-table-box-hover focus:duration-100",
45+
className
46+
)}
4847
{...props}
4948
>
5049
<Flex
51-
className={`action-card-image-wrapper flex h-[260px] flex-row bg-gradient-to-r from-accent-a/10 to-accent-c/10 ${isBottom ? "items-end" : "items-center"} ${isRight ? "justify-end" : "justify-center"} shadow-[inset_0px_-1px_0px_rgba(0,0,0,0.1)]`}
50+
className={cn(
51+
"action-card-image-wrapper flex h-[260px] flex-row bg-gradient-to-r from-accent-a/10 to-accent-c/10 shadow-[inset_0px_-1px_0px_rgba(0,0,0,0.1)]",
52+
isBottom ? "items-end" : "items-center",
53+
isRight ? "justify-end" : "justify-center"
54+
)}
5255
>
5356
<TwImage
5457
src={image}
@@ -69,7 +72,9 @@ const ActionCard = ({
6972
</InlineLink>
7073
</LinkOverlay>
7174
</h3>
72-
<p className={`mb-0 ${descriptionColor}`}>{description}</p>
75+
<p className={"mb-0 text-body opacity-65 dark:opacity-80"}>
76+
{description}
77+
</p>
7378
{children && <div className="mt-8">{children}</div>}
7479
</div>
7580
</LinkBox>

0 commit comments

Comments
 (0)