aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/layout/card.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-05-09 18:19:38 +0200
committerArmand Philippot <git@armandphilippot.com>2022-05-09 19:41:02 +0200
commit0d59a6d2995b4119865271ed1908ede0bb96497c (patch)
tree67688e41b7aa253aa58cc08aa360431b07382f9d /src/components/molecules/layout/card.tsx
parent339c6957fe92c4ec1809159f09c55201d3794c18 (diff)
refactor: rewrite DescriptionList and Meta components
The meta can have different layout. The previous implementation was not enough to easily change the layout. Also, I prefer to restrict the meta types and it prevents me to repeat myself for the labels.
Diffstat (limited to 'src/components/molecules/layout/card.tsx')
-rw-r--r--src/components/molecules/layout/card.tsx16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/components/molecules/layout/card.tsx b/src/components/molecules/layout/card.tsx
index 89f100e..e416bd5 100644
--- a/src/components/molecules/layout/card.tsx
+++ b/src/components/molecules/layout/card.tsx
@@ -1,13 +1,11 @@
import ButtonLink from '@components/atoms/buttons/button-link';
import Heading, { type HeadingLevel } from '@components/atoms/headings/heading';
-import DescriptionList, {
- type DescriptionListItem,
-} from '@components/atoms/lists/description-list';
import { FC } from 'react';
import ResponsiveImage, {
type ResponsiveImageProps,
} from '../images/responsive-image';
import styles from './card.module.scss';
+import Meta, { type MetaData } from './meta';
export type Cover = {
/**
@@ -44,7 +42,7 @@ export type CardProps = {
/**
* The card meta.
*/
- meta?: DescriptionListItem[];
+ meta?: MetaData;
/**
* The card tagline.
*/
@@ -96,13 +94,13 @@ const Card: FC<CardProps> = ({
<div className={styles.tagline}>{tagline}</div>
{meta && (
<footer className={styles.footer}>
- <DescriptionList
- items={meta}
+ <Meta
+ data={meta}
layout="inline"
className={styles.list}
- groupClassName={styles.items}
- termClassName={styles.term}
- descriptionClassName={styles.description}
+ groupClassName={styles.meta__item}
+ labelClassName={styles.meta__label}
+ valueClassName={styles.meta__value}
/>
</footer>
)}