Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix: replace next/image with regular img tags in TripView components

anandbaburajanda0eeb519dae
diff --git a/web/apps/photos/src/components/TripView/MobileCover.tsx b/web/apps/photos/src/components/TripView/MobileCover.tsx
index ad6ecd7073..50fe8de15d 100644
--- a/web/apps/photos/src/components/TripView/MobileCover.tsx
+++ b/web/apps/photos/src/components/TripView/MobileCover.tsx
@@ -1,5 +1,4 @@
import { Box, Skeleton, styled, Typography } from "@mui/material";
-import Image from "next/image";
import { memo } from "react";
import type { JourneyPoint } from "./types";
@@ -35,12 +34,16 @@ export const MobileCover = memo<MobileCoverProps>(
<MobileCoverContainer>
{coverImageUrl ? (
<>
- <Image
+ <img
src={coverImageUrl}
alt="Trip Cover"
- fill
- style={{ objectFit: "cover" }}
- sizes="100vw"
+ style={{
+ position: "absolute",
+ inset: 0,
+ width: "100%",
+ height: "100%",
+ objectFit: "cover"
+ }}
/>
<GradientOverlay />
</>
diff --git a/web/apps/photos/src/components/TripView/PhotoFan.tsx b/web/apps/photos/src/components/TripView/PhotoFan.tsx
index feee58e5da..0b93f1930c 100644
--- a/web/apps/photos/src/components/TripView/PhotoFan.tsx
+++ b/web/apps/photos/src/components/TripView/PhotoFan.tsx
@@ -1,5 +1,4 @@
import { Box, styled } from "@mui/material";
-import Image from "next/image";
import { memo } from "react";
import type { JourneyPoint } from "./types";
@@ -24,12 +23,17 @@ export const PhotoFan = memo<PhotoFanProps>(({ cluster, onPhotoClick }) => {
<BackgroundLoadingBox />
<ImageWrapper sx={{ transform: "skewY(-8deg) scale(1.1)" }}>
{cluster[1].image && cluster[1].image.trim() !== "" && (
- <Image
+ <img
src={cluster[1].image}
alt={cluster[1].name}
- fill
- style={{ objectFit: "cover", zIndex: 1 }}
- sizes="200px"
+ style={{
+ position: "absolute",
+ inset: 0,
+ width: "100%",
+ height: "100%",
+ objectFit: "cover",
+ zIndex: 1
+ }}
/>
)}
</ImageWrapper>
@@ -50,15 +54,17 @@ export const PhotoFan = memo<PhotoFanProps>(({ cluster, onPhotoClick }) => {
>
{cluster[1].image &&
cluster[1].image.trim() !== "" && (
- <Image
+ <img
src={cluster[1].image}
alt={cluster[1].name}
- fill
style={{
+ position: "absolute",
+ inset: 0,
+ width: "100%",
+ height: "100%",
objectFit: "cover",
- zIndex: 1,
+ zIndex: 1
}}
- sizes="200px"
/>
)}
</ImageWrapper>
@@ -77,15 +83,17 @@ export const PhotoFan = memo<PhotoFanProps>(({ cluster, onPhotoClick }) => {
>
{cluster[2].image &&
cluster[2].image.trim() !== "" && (
- <Image
+ <img
src={cluster[2].image}
alt={cluster[2].name}
- fill
style={{
+ position: "absolute",
+ inset: 0,
+ width: "100%",
+ height: "100%",
objectFit: "cover",
- zIndex: 1,
+ zIndex: 1
}}
- sizes="200px"
/>
)}
</ImageWrapper>
@@ -101,12 +109,16 @@ export const PhotoFan = memo<PhotoFanProps>(({ cluster, onPhotoClick }) => {
}
>
{cluster[0].image && cluster[0].image.trim() !== "" ? (
- <Image
+ <img
src={cluster[0].image}
alt={cluster[0].name}
- fill
- style={{ objectFit: "cover" }}
- sizes="150px"
+ style={{
+ position: "absolute",
+ inset: 0,
+ width: "100%",
+ height: "100%",
+ objectFit: "cover"
+ }}
/>
) : (
<LoadingBox />
diff --git a/web/apps/photos/src/components/TripView/TripCover.tsx b/web/apps/photos/src/components/TripView/TripCover.tsx
index 228ac53c92..82c7ebb09a 100644
--- a/web/apps/photos/src/components/TripView/TripCover.tsx
+++ b/web/apps/photos/src/components/TripView/TripCover.tsx
@@ -1,6 +1,5 @@
import { Box, Skeleton, styled, Typography } from "@mui/material";
import { EnteLogo } from "ente-base/components/EnteLogo";
-import Image from "next/image";
import { memo } from "react";
import type { JourneyPoint } from "./types";
@@ -37,12 +36,16 @@ export const TripCover = memo<TripCoverProps>(
<CoverImageContainer>
{coverImageUrl ? (
<>
- <Image
+ <img
src={coverImageUrl}
alt="Trip Cover"
- fill
- style={{ objectFit: "cover" }}
- sizes="600px"
+ style={{
+ position: "absolute",
+ inset: 0,
+ width: "100%",
+ height: "100%",
+ objectFit: "cover"
+ }}
/>
<GradientOverlay />
</>