From dc33d9b3abb780bf8d25e9d277011638b014b405 Mon Sep 17 00:00:00 2001 From: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:08:42 +0100 Subject: [PATCH] add image sizes to network request --- web/src/components/BlogCard/BlogCard.tsx | 4 +++- web/src/components/BlogListItem/BlogListItem.tsx | 4 +++- .../IndividualBlogPostCell/IndividualBlogPostCell.tsx | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web/src/components/BlogCard/BlogCard.tsx b/web/src/components/BlogCard/BlogCard.tsx index 0580c91..6d89ef2 100644 --- a/web/src/components/BlogCard/BlogCard.tsx +++ b/web/src/components/BlogCard/BlogCard.tsx @@ -25,6 +25,8 @@ interface BlogCardProps { } const BlogCard = ({ post }: BlogCardProps) => { + const profilePictureUrl = new URL(post.author.profilePicture) + profilePictureUrl.searchParams.set('height', '128') return (

@@ -54,7 +56,7 @@ const BlogCard = ({ post }: BlogCardProps) => { className="text-black dark:text-white" /> - +

) diff --git a/web/src/components/BlogListItem/BlogListItem.tsx b/web/src/components/BlogListItem/BlogListItem.tsx index 1492bec..f5550d0 100644 --- a/web/src/components/BlogListItem/BlogListItem.tsx +++ b/web/src/components/BlogListItem/BlogListItem.tsx @@ -23,6 +23,8 @@ interface Props { } const BlogListItem = ({ post }: Props) => { + const profilePictureUrl = new URL(post.author.profilePicture) + profilePictureUrl.searchParams.set('height', '128') return (

@@ -55,7 +57,7 @@ const BlogListItem = ({ post }: Props) => { {/* author */}
- +
{post.author.name}
diff --git a/web/src/components/IndividualBlogPostCell/IndividualBlogPostCell.tsx b/web/src/components/IndividualBlogPostCell/IndividualBlogPostCell.tsx index 155a59e..b576c9c 100644 --- a/web/src/components/IndividualBlogPostCell/IndividualBlogPostCell.tsx +++ b/web/src/components/IndividualBlogPostCell/IndividualBlogPostCell.tsx @@ -84,6 +84,10 @@ export const Success = ({ }, [post]) const { origin } = useLocation() + + const profilePictureUrl = new URL(post.author.profilePicture) + profilePictureUrl.searchParams.set('height', '128') + return (
- +
{post.author.name}