Skip to content

Commit

Permalink
♻️ Check for imageExtended rather than hasImage
Browse files Browse the repository at this point in the history
  • Loading branch information
petterhh committed Dec 19, 2024
1 parent 08d47f1 commit d1d5719
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/sections/article/Article.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function Article({ article }: ArticleProps) {
return (
<article className={styles.wrapper} id={article._key}>
<div className={styles.article}>
{hasImage(article) && (
{article.imageExtended && (
<div className={styles.image}>
<SanityImage image={article.imageExtended} />
</div>
Expand All @@ -31,7 +31,3 @@ export default function Article({ article }: ArticleProps) {
</article>
);
}

function hasImage(article: ArticleSection) {
return Boolean(article?.imageExtended?.src || article?.imageExtended?.asset);
}

0 comments on commit d1d5719

Please sign in to comment.