diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-06-07 16:02:21 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-06-07 17:13:40 +0200 |
| commit | 73f94705dc583e968114e5a09e85979448f3412b (patch) | |
| tree | 45b7dd12f1af6a44caabab31a28c98f8749d08ff /src/components/molecules/layout/card.tsx | |
| parent | d54fc38899b3ffc87104ed03f5e48be3f02e337c (diff) | |
chore(cards): use post title as link label
Diffstat (limited to 'src/components/molecules/layout/card.tsx')
| -rw-r--r-- | src/components/molecules/layout/card.tsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/components/molecules/layout/card.tsx b/src/components/molecules/layout/card.tsx index 7bbd040..c48bc18 100644 --- a/src/components/molecules/layout/card.tsx +++ b/src/components/molecules/layout/card.tsx @@ -22,6 +22,10 @@ export type CardProps = { */ coverFit?: ResponsiveImageProps['objectFit']; /** + * The card id. + */ + id: string; + /** * The card meta. */ meta?: MetaData; @@ -52,6 +56,7 @@ const Card: FC<CardProps> = ({ className = '', cover, coverFit = 'cover', + id, meta, tagline, title, @@ -59,7 +64,11 @@ const Card: FC<CardProps> = ({ url, }) => { return ( - <ButtonLink target={url} className={`${styles.wrapper} ${className}`}> + <ButtonLink + aria-labelledby={`${id}-heading`} + target={url} + className={`${styles.wrapper} ${className}`} + > <article className={styles.article}> <header className={styles.header}> {cover && ( @@ -71,8 +80,9 @@ const Card: FC<CardProps> = ({ )} <Heading alignment="center" - level={titleLevel} className={styles.title} + id={`${id}-heading`} + level={titleLevel} > {title} </Heading> |
