refactor: update image rendering logic in MainPageLayout to load images conditionally based on opacity for improved performance
This commit is contained in:
@@ -612,11 +612,11 @@ const MainPageLayout = () => {
|
|||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{/* Image loaded only when needed */}
|
||||||
|
{getOpacity(pageType) === 1 && (
|
||||||
<img
|
<img
|
||||||
src={box.image}
|
src={box.image}
|
||||||
alt={box.title}
|
alt={box.title}
|
||||||
fetchPriority="high"
|
|
||||||
loading="eager"
|
|
||||||
style={{
|
style={{
|
||||||
maxWidth: "100%",
|
maxWidth: "100%",
|
||||||
maxHeight: "100%",
|
maxHeight: "100%",
|
||||||
@@ -627,6 +627,7 @@ const MainPageLayout = () => {
|
|||||||
transform: "translate(-50%, -50%)",
|
transform: "translate(-50%, -50%)",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
|
|||||||
Reference in New Issue
Block a user