Skip to content

Commit

Permalink
refactor(core): change thumbnail prop to image in BlogPostCard (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemoya authored Aug 5, 2024
1 parent 127f3b6 commit 5f934f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-vans-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bigcommerce/catalyst-core": patch
---

Change prop `thumbnail` to `image` in BlogPostCard.
2 changes: 1 addition & 1 deletion core/components/blog-post-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export const BlogPostCard = async ({ data }: Props) => {
author={data.author}
content={data.plainTextSummary}
date={format.dateTime(new Date(data.publishedDate.utc))}
image={data.thumbnailImage}
link={{ href: `/blog/${data.entityId}` }}
thumbnail={data.thumbnailImage}
title={data.name}
/>
);
Expand Down
10 changes: 5 additions & 5 deletions core/components/ui/blog-post-card/blog-post-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ interface Props extends ComponentPropsWithRef<'div'> {
author?: string | null;
content: string;
date: string;
image?: { altText: string; url: string } | null;
link: { href: string };
thumbnail?: { altText: string; url: string } | null;
title: string;
}

Expand All @@ -19,21 +19,21 @@ const BlogPostCard = ({
className,
content,
date,
image,
link,
thumbnail,
title,
...props
}: Props) => {
return (
<div className={cn('flex flex-col', className)} {...props}>
{thumbnail ? (
{image ? (
<div className="mb-2 flex h-44 lg:h-56">
<Link className="block w-full" href={link.href}>
<BcImage
alt={thumbnail.altText}
alt={image.altText}
className="h-full w-full object-cover object-center"
height={300}
src={thumbnail.url}
src={image.url}
width={300}
/>
</Link>
Expand Down

0 comments on commit 5f934f9

Please sign in to comment.