mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
perf: optimize next/image sizes with dynamic maxWidth (#1089)
This commit is contained in:
parent
e1e4bb4706
commit
0bdc08162e
1 changed files with 2 additions and 2 deletions
|
|
@ -288,7 +288,7 @@ export function Image({
|
|||
alt={alt}
|
||||
width={0}
|
||||
height={0}
|
||||
sizes="100vw"
|
||||
sizes={`(max-width: ${maxWidth}) 100vw, ${maxWidth}`}
|
||||
loading="eager"
|
||||
className={cn(
|
||||
"w-full h-auto transition-transform duration-300",
|
||||
|
|
@ -307,7 +307,7 @@ export function Image({
|
|||
src={src}
|
||||
alt={alt}
|
||||
fill
|
||||
sizes="(max-width: 512px) 100vw, 512px"
|
||||
sizes={`(max-width: ${maxWidth}) 100vw, ${maxWidth}`}
|
||||
className={cn(
|
||||
"transition-transform duration-300",
|
||||
fit === "cover" ? "object-cover" : "object-contain",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue