Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web][photos] Fix TripLayout mobile viewport and scrolling issues

anandbaburajan566d2f5a6ce3
diff --git a/web/apps/photos/src/components/TripLayout/MobileTimelineLocation.tsx b/web/apps/photos/src/components/TripLayout/MobileTimelineLocation.tsx
index d155fee87f..27fad9f251 100644
--- a/web/apps/photos/src/components/TripLayout/MobileTimelineLocation.tsx
+++ b/web/apps/photos/src/components/TripLayout/MobileTimelineLocation.tsx
@@ -88,9 +88,9 @@ const MobileLocationContainer = styled(Box)({
alignItems: "center",
justifyContent: "center",
width: "100%",
- height: "40vh",
+ height: "40svh",
scrollSnapAlign: "start",
- padding: "20px",
+ padding: "0",
});
const CenteredPhotoContainer = styled(Box)({
diff --git a/web/apps/photos/src/components/TripLayout/MobileTripStarted.tsx b/web/apps/photos/src/components/TripLayout/MobileTripStarted.tsx
index d74d496cd8..73c4707a9a 100644
--- a/web/apps/photos/src/components/TripLayout/MobileTripStarted.tsx
+++ b/web/apps/photos/src/components/TripLayout/MobileTripStarted.tsx
@@ -52,9 +52,9 @@ const MobileTripStartedContainer = styled(Box)({
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
- height: "40vh",
+ height: "40svh",
scrollSnapAlign: "start",
- padding: "60px 20px 40px 20px",
+ padding: "0",
overflow: "visible",
});
diff --git a/web/apps/photos/src/components/TripLayout/index.tsx b/web/apps/photos/src/components/TripLayout/index.tsx
index 51e7229c8d..74af4e10bc 100644
--- a/web/apps/photos/src/components/TripLayout/index.tsx
+++ b/web/apps/photos/src/components/TripLayout/index.tsx
@@ -383,30 +383,9 @@ export const TripLayout: React.FC<TripLayoutProps> = ({
<MobileTimelineContainer ref={timelineRef}>
<MobileTimelineContent>
{isInitialLoad ? (
- <LoadingCoverPlaceholder>
- <LoadingCoverImage>
- <CoverGradientOverlay />
- <CoverPlaceholderContent>
- <PlaceholderTextBox
- sx={{
- height: "30px",
- width: "200px",
- mb: "2px",
- }}
- />
- <PlaceholderTextBox
- sx={{
- height: "16px",
- width: "120px",
- margin: 0,
- }}
- />
- </CoverPlaceholderContent>
- </LoadingCoverImage>
- <LoadingSpinnerContainer>
- <LoadingSpinner />
- </LoadingSpinnerContainer>
- </LoadingCoverPlaceholder>
+ <MobileLoadingContainer>
+ <LoadingSpinner />
+ </MobileLoadingContainer>
) : journeyData.length > 0 ? (
<div>
{isLoadingLocations ? (
@@ -738,18 +717,18 @@ const NoPhotosContainer = styled(Box)(({ theme }) => ({
const MobileContainer = styled(Box)({
display: "flex",
flexDirection: "column",
- height: "100vh",
+ height: "100svh",
width: "100%",
});
const MobileMapContainer = styled(Box)({
- height: "calc(60% + 20px)",
+ height: "calc(60svh + 20px)",
position: "relative",
overflow: "hidden",
});
const MobileTimelineContainer = styled(Box)(({ theme }) => ({
- height: "40%",
+ height: "40svh",
marginTop: "-20px",
overflow: "auto",
backgroundColor: theme.palette.background.paper,
@@ -784,19 +763,27 @@ const MobileCoverOverlay = styled(Box, {
}));
const MobileTimelineContent = styled(Box)({
- padding: "16px 20px",
+ padding: "0",
height: "100%",
display: "flex",
flexDirection: "column",
});
+const MobileLoadingContainer = styled(Box)({
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ height: "100%",
+ width: "100%",
+});
+
const MobileTimelineBaseLine = styled(Box, {
shouldForwardProp: (prop) => prop !== "photoClusters",
})<{ photoClusters: JourneyPoint[][] }>(({ theme, photoClusters }) => ({
position: "absolute",
left: "50%",
- top: "-15vh",
- height: `${(photoClusters.length - 1) * 40 + 35}vh`,
+ top: "-15svh",
+ height: `${(photoClusters.length - 1) * 40 + 35}svh`,
width: "3px",
backgroundColor: theme.palette.grey[300],
transform: "translateX(-1.5px)",