Skip to content

Commit 0e137b9

Browse files
committed
refactor: BentoCard, ui/card
compose with reusable components, move to Homepage component folder
1 parent d77ac49 commit 0e137b9

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/components/BentoBox/BentoCard.tsx renamed to src/components/Homepage/BentoCard.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import { ButtonLink } from "@/components/ui/buttons/Button"
77

88
import { cn } from "@/lib/utils/cn"
99

10+
import { Card, CardTitle } from "../ui/card"
11+
import { Center } from "../ui/flex"
12+
1013
export type BentoCardProps = HTMLAttributes<HTMLDivElement> & {
1114
action: string
1215
href: string
@@ -26,23 +29,25 @@ const BentoCard = ({
2629
imgHeight,
2730
title,
2831
}: BentoCardProps) => (
29-
<div
32+
<Card
3033
className={cn(
31-
"bg-gradient-to-right flex items-center justify-evenly gap-4 rounded-2xl border p-8 lg:gap-16",
34+
"bg-gradient-to-right flex items-center justify-evenly gap-4 border p-8 lg:gap-16",
3235
className
3336
)}
3437
>
35-
<div className="mb-6 grid place-items-center">
38+
<Center>
3639
<TwImage src={imgSrc} alt="" width={imgWidth} height={imgHeight} />
37-
</div>
40+
</Center>
3841
<div>
39-
<h3 className="mb-2 text-3xl font-black">{title}</h3>
42+
<CardTitle variant="black" className="mb-2">
43+
{title}
44+
</CardTitle>
4045
<p className="mb-8 text-md">{children}</p>
4146
<ButtonLink href={href} variant="outline">
4247
{action} <MdChevronRight />
4348
</ButtonLink>
4449
</div>
45-
</div>
50+
</Card>
4651
)
4752

4853
export default BentoCard

src/components/ui/card.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { BaseLink } from "./Link"
88
const titleVariants = cva("group-hover:underline", {
99
variants: {
1010
variant: {
11-
normal: "font-normal text-lg",
12-
strong: "text-2xl font-bold",
11+
bold: "text-2xl font-bold",
12+
black: "text-3xl font-black",
1313
},
1414
},
1515
defaultVariants: {
16-
variant: "strong",
16+
variant: "bold",
1717
},
1818
})
1919

0 commit comments

Comments
 (0)