feat: add card grid component

This commit is contained in:
Christel Westerberg
2024-04-26 08:19:19 +02:00
parent 2ddabf1e50
commit 00f30811cf
33 changed files with 575 additions and 121 deletions

View 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;
}

View File

@@ -0,0 +1,9 @@
export type CardProps = {
link?: {
href: string
title: string
}
title?: string
subtitle?: string
openInNewTab?: boolean
}

View 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>
)
}