Skip to content

armgit / ente

Public Imported from GitHub
0

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

[space][web] Correct iOS PWA post media positioning

Anand Baburajan17302f298f21
diff --git a/web/apps/space/src/components/FileViewer.tsx b/web/apps/space/src/components/FileViewer.tsx
index a51abdac13..110ef40af6 100644
--- a/web/apps/space/src/components/FileViewer.tsx
+++ b/web/apps/space/src/components/FileViewer.tsx
@@ -213,21 +213,21 @@ const viewerPadding = (
) => {
const isDesktop = window.innerWidth >= viewerDesktopMinWidth;
let top = isDesktop ? 0 : headerHeight;
+ let bottom = hasDraftPhotoControls
+ ? 176
+ : isDesktop
+ ? 0
+ : viewerBottomPadding;
if (header && document.documentElement.hasAttribute("data-space-ios-pwa")) {
+ const headerStyle = getComputedStyle(header);
top = isDesktop
- ? parseFloat(getComputedStyle(header).paddingTop)
+ ? parseFloat(headerStyle.paddingTop)
: header.offsetHeight;
+ bottom += parseFloat(
+ headerStyle.getPropertyValue("--space-ios-safe-area-bottom"),
+ );
}
- return {
- bottom: hasDraftPhotoControls
- ? 176
- : isDesktop
- ? 0
- : viewerBottomPadding,
- left: 0,
- right: 0,
- top,
- };
+ return { bottom, left: 0, right: 0, top };
};
// index is the photo whose dots are shown, position the gallery index as a float.
diff --git a/web/apps/space/src/styles/globals.css b/web/apps/space/src/styles/globals.css
index 2f833d25c4..47e55b1005 100644
--- a/web/apps/space/src/styles/globals.css
+++ b/web/apps/space/src/styles/globals.css
@@ -11,6 +11,7 @@ html[data-space-ios-pwa]:has(.space-onboarding) body {
html[data-space-ios-pwa] {
--space-ios-safe-area-top: env(safe-area-inset-top);
+ --space-ios-safe-area-bottom: env(safe-area-inset-bottom);
--space-ios-safe-area-left: env(safe-area-inset-left);
--space-ios-safe-area-right: env(safe-area-inset-right);
}