Skip to content

Commit

Permalink
add image sizes to network request
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Walker-GM committed Jun 19, 2024
1 parent 69a6e6d commit dc33d9b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion web/src/components/BlogCard/BlogCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ interface BlogCardProps {
}

const BlogCard = ({ post }: BlogCardProps) => {
const profilePictureUrl = new URL(post.author.profilePicture)
profilePictureUrl.searchParams.set('height', '128')
return (
<article className="rounded-[4px] border-1 border-maiTai p-7 pb-5">
<h4 className="mb-2 text-sm font-bold uppercase text-maiTai">
Expand Down Expand Up @@ -54,7 +56,7 @@ const BlogCard = ({ post }: BlogCardProps) => {
className="text-black dark:text-white"
/>
</Link>
<Avatar alt={post.author.name} src={post.author.profilePicture} />
<Avatar alt={post.author.name} src={profilePictureUrl} />
</div>
</article>
)
Expand Down
4 changes: 3 additions & 1 deletion web/src/components/BlogListItem/BlogListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ interface Props {
}

const BlogListItem = ({ post }: Props) => {
const profilePictureUrl = new URL(post.author.profilePicture)
profilePictureUrl.searchParams.set('height', '128')
return (
<article>
<h3 className="mb-2 text-sm font-bold uppercase text-maiTai">
Expand Down Expand Up @@ -55,7 +57,7 @@ const BlogListItem = ({ post }: Props) => {

{/* author */}
<div className="flex items-center gap-x-6">
<Avatar alt={post.author.name} src={post.author.profilePicture} />
<Avatar alt={post.author.name} src={profilePictureUrl} />
<div>
<div className="text-lg">{post.author.name}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export const Success = ({
}, [post])

const { origin } = useLocation()

const profilePictureUrl = new URL(post.author.profilePicture)
profilePictureUrl.searchParams.set('height', '128')

return (
<div className="page-grid">
<Metadata
Expand All @@ -104,7 +108,7 @@ export const Success = ({
</h2>

<div className="mb-10 flex items-center gap-3">
<Avatar alt={post.author.name} src={post.author.profilePicture} />
<Avatar alt={post.author.name} src={profilePictureUrl} />
<div className="text-lg text-black dark:text-white">
{post.author.name}
</div>
Expand Down

0 comments on commit dc33d9b

Please sign in to comment.