Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates): adds priority to hero images #10003

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 1 addition & 7 deletions templates/website/src/heros/HighImpact/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ export const HighImpactHero: React.FC<Page['hero']> = ({ links, media, richText
</div>
<div className="min-h-[80vh] select-none">
{media && typeof media === 'object' && (
<Media
fill
imgClassName="-z-10 object-cover"
priority={false}
loading="lazy"
resource={media}
/>
<Media fill imgClassName="-z-10 object-cover" priority resource={media} />
)}
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions templates/website/src/heros/MediumImpact/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export const MediumImpactHero: React.FC<Page['hero']> = ({ links, media, richTex
<Media
className="-mx-4 md:-mx-8 2xl:-mx-16"
imgClassName=""
priority={false}
loading="lazy"
priority
resource={media}
/>
{media?.caption && (
Expand Down
8 changes: 1 addition & 7 deletions templates/website/src/heros/PostHero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ export const PostHero: React.FC<{
</div>
<div className="min-h-[80vh] select-none">
{heroImage && typeof heroImage !== 'string' && (
<Media
fill
priority={false}
loading="lazy"
imgClassName="-z-10 object-cover"
resource={heroImage}
/>
<Media fill priority imgClassName="-z-10 object-cover" resource={heroImage} />
)}
<div className="absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-to-t from-black to-transparent" />
</div>
Expand Down
8 changes: 1 addition & 7 deletions templates/with-vercel-website/src/heros/HighImpact/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ export const HighImpactHero: React.FC<Page['hero']> = ({ links, media, richText
</div>
<div className="min-h-[80vh] select-none">
{media && typeof media === 'object' && (
<Media
fill
imgClassName="-z-10 object-cover"
priority={false}
loading="lazy"
resource={media}
/>
<Media fill imgClassName="-z-10 object-cover" priority resource={media} />
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export const MediumImpactHero: React.FC<Page['hero']> = ({ links, media, richTex
<Media
className="-mx-4 md:-mx-8 2xl:-mx-16"
imgClassName=""
priority={false}
loading="lazy"
priority
resource={media}
/>
{media?.caption && (
Expand Down
8 changes: 1 addition & 7 deletions templates/with-vercel-website/src/heros/PostHero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ export const PostHero: React.FC<{
</div>
<div className="min-h-[80vh] select-none">
{heroImage && typeof heroImage !== 'string' && (
<Media
fill
priority={false}
loading="lazy"
imgClassName="-z-10 object-cover"
resource={heroImage}
/>
<Media fill priority imgClassName="-z-10 object-cover" resource={heroImage} />
)}
<div className="absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-to-t from-black to-transparent" />
</div>
Expand Down