Update ImageUrl types

This commit is contained in:
Michael Fatemi 2021-01-11 19:26:02 -05:00
parent 4a0d32a42e
commit cbf84db701
2 changed files with 5 additions and 2 deletions

View File

@ -13,7 +13,10 @@ export default function ArticleRow({
let thumbnail: React.ReactElement | null = null;
if (article.thumbnail) {
thumbnail = (
<img src={imageUrl(article.thumbnail).url()} alt={article.title} />
<img
src={imageUrl(article.thumbnail).url() ?? undefined}
alt={article.title}
/>
);
}

View File

@ -14,7 +14,7 @@ export default function NewsArticle() {
let thumbnailUrl = '/images/hero.png';
if (article?.thumbnail) {
thumbnailUrl = imageUrl(article.thumbnail).url();
thumbnailUrl = imageUrl(article.thumbnail).url()!;
}
const goToAllNewsArticles = (