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

Performance: optimize hero images #13106

Merged
merged 1 commit into from
Jun 7, 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
3 changes: 2 additions & 1 deletion src/components/Hero/ContentHero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const ContentHero = (props: ContentHeroProps) => {
blurDataURL={blurDataURL}
width={760}
height={451}
sizes="(max-width: 992px) 100vw, 50vw"
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
sizes="(max-width: 992px) 100vw, 760px"
boxSize="full"
style={{ objectFit: "contain" }}
flex={{ base: "1 1 100%", md: "none" }}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Hero/HubHero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const HubHero = ({
src={heroImg}
alt=""
priority
sizes="100vw"
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
sizes="(max-width: 1504px) 100vw, 1504px"
style={{ width: "100vw", objectFit: "cover" }}
h={{
base: "192px",
Expand Down
3 changes: 2 additions & 1 deletion src/components/PageHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ const PageHero = ({
>
<Image
src={image}
sizes="(max-width: 992px) 100vw, 50vw"
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
sizes="(max-width: 992px) 100vw, 624px"
style={{
width: "100%",
height: "auto",
Expand Down
2 changes: 2 additions & 0 deletions src/layouts/Roadmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ export const RoadmapLayout = ({
style={{ objectFit: "contain" }}
width={1504}
height={336}
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
sizes="(max-width: 992px) 100vw, 720px"
priority
/>
</Center>
Expand Down
1 change: 1 addition & 0 deletions src/layouts/UseCases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export const UseCasesLayout = ({
width={1200}
height={610}
style={{ objectFit: "cover" }}
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
sizes="(max-width: 992px) 100vw, 750px"
priority
alignSelf={{
Expand Down
3 changes: 2 additions & 1 deletion src/pages/eth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ const EthPage = () => {
<Hero>
<Image
src={eth}
width={800}
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
sizes="(max-width: 768px) 100vw, 800px"
alt={t("page-eth-whats-eth-hero-alt")}
priority
/>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/wallets/find-wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ const FindWalletPage = () => {
<Center w={{ base: "full", sm: "50%" }}>
<Image
src={HeroImage}
width={500}
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
sizes="(max-width: 480px) 100vw, 500px"
alt=""
priority
style={{
Expand Down
2 changes: 2 additions & 0 deletions src/pages/what-is-ethereum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ const WhatIsEthereumPage = ({
<Image
src={hero}
alt={t("page-what-is-ethereum-alt-img-bazaar")}
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
sizes="(max-width: 992px) 100vw, 750px"
priority
/>
</Hero>
Expand Down
Loading