Skip to content

Commit 6b992c9

Browse files
committed
feat(challenges): create challenge grid tile component with Tailwind Variants
1 parent 6cf6c15 commit 6b992c9

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { tv } from "tailwind-variants/lite";
2+
import Button from "../Button";
3+
import { FaArrowRight } from "react-icons/fa6";
4+
5+
const tileVariants = tv({
6+
base: 'font-poppins flex flex-col justify-start py-6 px-4 rounded-lg shadow-[0_4px_15px_rgba(0,0,0,0.25)]',
7+
8+
variants: {
9+
size: {
10+
sm: 'h-[222px]',
11+
lg: 'h-[222px] md:h-[340px]'
12+
},
13+
span: {
14+
2: 'col-span-1 md:col-span-2',
15+
3: 'col-span-1 md:col-span-3'
16+
}
17+
},
18+
});
19+
20+
export default function ChallengeTile({ size, span, title, subtitle, tags, to }){
21+
return (
22+
<div className={tileVariants({ size, span })}>
23+
<div className="h-full flex flex-col justify-between">
24+
<div className="flex flex-col gap-2">
25+
<h2 className="text-lg md:text-[20px] font-medium">{title}</h2>
26+
<p className="text-base">{subtitle}</p>
27+
</div>
28+
{/* tag and button */}
29+
<div className="flex flex-row justify-between items-center">
30+
<p>{tags}</p>
31+
<Button
32+
size='circ'
33+
color='primary'
34+
label={<FaArrowRight/>}
35+
to={to}
36+
/>
37+
</div>
38+
</div>
39+
</div>
40+
);
41+
};

0 commit comments

Comments
 (0)