Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/components/elements/GridCard/GridCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@
align-items: center;
gap: 0.375rem;
margin-left: auto;
flex-shrink: 0;
}

.icons svg {
width: 22px;
height: 22px;
width: 32px;
height: 32px;
pointer-events: none;
}

Expand All @@ -83,11 +84,19 @@
flex: 1;
}

.cardFooter {
display: flex;
align-items: center;
gap: 0.5rem;
margin-top: auto;
}

.cardMeta {
display: flex;
flex-wrap: wrap;
gap: 0.375rem;
margin-top: auto;
flex: 1;
min-width: 0;
}

.badge {
Expand Down
22 changes: 13 additions & 9 deletions src/components/elements/GridCard/GridCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type GridCardProps = {
description: string;
href: string;
tags?: string[];
/** Rendered top-right of the header, e.g. an SDK logo. */
/** Rendered bottom-right, alongside the tags, e.g. an SDK logo. */
icon?: React.ReactNode;
analyticsId?: string;
};
Expand All @@ -69,16 +69,20 @@ export default function GridCard({ title, description, href, tags = [], icon, an
{title}
{showExternalIcon && <ExternalLinkIcon />}
</h3>
{icon && <div className={styles.icons}>{icon}</div>}
</div>
<p className={styles.cardDescription}>{description}</p>
{tags.length > 0 && (
<div className={styles.cardMeta}>
{tags.map((tag) => (
<span key={tag} className={styles.badge}>
{tag}
</span>
))}
{(tags.length > 0 || icon) && (
<div className={styles.cardFooter}>
{tags.length > 0 && (
<div className={styles.cardMeta}>
{tags.map((tag) => (
<span key={tag} className={styles.badge}>
{tag}
</span>
))}
</div>
)}
{icon && <div className={styles.icons}>{icon}</div>}
</div>
)}
</Link>
Expand Down