Skip to content

Commit

Permalink
fix: optimize Image component (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlitgrace authored Oct 30, 2024
1 parent fc31fd8 commit 4e21863
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion app/(routes)/(main)/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export default async function Page({ params }: { params: { slug: string } }) {
priority={true}
width={0}
height={0}
sizes="100vw"
style={{ width: '100%', height: 'auto' }}
className="rounded-2xl"
/>
Expand Down
19 changes: 9 additions & 10 deletions app/(routes)/(main)/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,15 @@ export default async function BlogPage() {
)}
>
{post.cover && (
<Image
src={post.cover}
alt={post.title}
priority={true}
width={0}
height={0}
sizes="100vw"
style={{ width: '100%', height: 'auto' }}
className="rounded-2xl"
/>
<div className="relative aspect-video h-auto w-full">
<Image
src={post.cover}
alt={post.title}
priority={true}
fill
className="rounded-2xl"
/>
</div>
)}
<div className="flex flex-col gap-2">
<div className="flex items-center justify-between">
Expand Down

0 comments on commit 4e21863

Please sign in to comment.