Add alt text to feature image on blog post

This commit is contained in:
Lucas Phang 2021-05-07 15:17:41 +10:00
parent 5d787c5054
commit 2efcc00d52
2 changed files with 7 additions and 3 deletions

View File

@ -27,7 +27,10 @@ export function Article(props: IPost) {
<article>
<div className="flex flex-col items-center mt-10 mb-16 space-y-4">
<Contained>
<ArticleSectionFeatureImage featureImage={featureImage} />
<ArticleSectionFeatureImage
featureImage={featureImage}
title={title}
/>
</Contained>
<ArticleContained>

View File

@ -2,15 +2,16 @@ import { IFigureImage } from '../../../types/cms';
interface Props {
featureImage: IFigureImage;
title: string;
}
export function ArticleSectionFeatureImage({ featureImage }: Props) {
export function ArticleSectionFeatureImage({ featureImage, title }: Props) {
return (
<div className="w-full pb-4 desktop:pb-0">
<div className="relative w-full mb-4 aspect-w-14 aspect-h-8">
<img
src={featureImage?.imageUrl}
alt={featureImage?.description ?? ''}
alt={featureImage?.description ?? title}
className="object-cover rounded"
/>
</div>