Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

bugfix/COR-1249-image-article-fix #4660

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/app/src/components/article-teaser.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
import css from '@styled-system/css';
import { ReactNode } from 'react';
import styled from 'styled-components';
Expand All @@ -9,6 +10,7 @@ import { Link } from '~/utils/link';
import { BackgroundImage } from './background-image';
import { Box } from './base';
import { Anchor, Heading, Text, BoldText } from './typography';
import { getImageProps } from '~/lib/sanity';

export type ArticleSummary = Pick<Article, 'title' | 'slug' | 'summary' | 'cover' | 'category' | 'categories'>;

Expand All @@ -24,12 +26,15 @@ export function ArticleTeaser(props: ArticleTeaserProps) {
const { title, slug, summary, cover, coverSizes } = props;
const { commonTexts } = useIntl();

const { src } = getImageProps(cover, {});

return (
<Link passHref href={`/artikelen/${slug}`}>
<StyledArticleTeaser>
{cover.asset && (
<ZoomContainer height="200px">
<BackgroundImage image={cover} height="200px" sizes={coverSizes} />
{/* <BackgroundImage image={cover} height="200px" sizes={coverSizes} /> */}
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
<img src={src} />
</ZoomContainer>
)}

Expand Down