feat: add card grid component
This commit is contained in:
15
components/TempDesignSystem/Card/card.module.css
Normal file
15
components/TempDesignSystem/Card/card.module.css
Normal file
@@ -0,0 +1,15 @@
|
||||
.linkCard {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 37rem;
|
||||
width: 100%;
|
||||
margin-right: 1.6rem;
|
||||
border-radius: 1.6rem;
|
||||
gap: 1rem;
|
||||
padding: 1.6rem;
|
||||
|
||||
background-color: var(--Base-Fill-Normal);
|
||||
text-align: center;
|
||||
}
|
||||
9
components/TempDesignSystem/Card/card.ts
Normal file
9
components/TempDesignSystem/Card/card.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export type CardProps = {
|
||||
link?: {
|
||||
href: string
|
||||
title: string
|
||||
}
|
||||
title?: string
|
||||
subtitle?: string
|
||||
openInNewTab?: boolean
|
||||
}
|
||||
38
components/TempDesignSystem/Card/index.tsx
Normal file
38
components/TempDesignSystem/Card/index.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import { _ } from "@/lib/translation"
|
||||
|
||||
import Title from "@/components/Title"
|
||||
|
||||
import Button from "../Button"
|
||||
import Link from "../Link"
|
||||
import { CardProps } from "./card"
|
||||
|
||||
import styles from "./card.module.css"
|
||||
|
||||
export default function Card({
|
||||
link,
|
||||
subtitle,
|
||||
title,
|
||||
openInNewTab = false,
|
||||
}: CardProps) {
|
||||
return (
|
||||
<div className={styles.linkCard}>
|
||||
{title ? (
|
||||
<Title level="h3" weight="semiBold">
|
||||
{title}
|
||||
</Title>
|
||||
) : null}
|
||||
{subtitle ? (
|
||||
<Title level="h5" weight="light">
|
||||
{subtitle}
|
||||
</Title>
|
||||
) : null}
|
||||
{link ? (
|
||||
<Button asChild intent="primary">
|
||||
<Link href={link.href} target={openInNewTab ? "_blank" : undefined}>
|
||||
{link.title}
|
||||
</Link>
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user