Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(photos):fixed-scrollbar-on-desktop

Aswin Asokd9a63bdba2eb
diff --git a/web/apps/photos/src/components/PhotosAuthShell.tsx b/web/apps/photos/src/components/PhotosAuthShell.tsx
index bcadcb729b..f0dde3db70 100644
--- a/web/apps/photos/src/components/PhotosAuthShell.tsx
+++ b/web/apps/photos/src/components/PhotosAuthShell.tsx
@@ -1,5 +1,6 @@
import { AuthPageShell } from "ente-accounts/components/auth/AuthPageShell";
import type { AuthPresentationConfig } from "ente-accounts/components/auth/styles";
+import { isDesktop } from "ente-base/app";
import { t } from "i18next";
import type React from "react";
@@ -42,6 +43,11 @@ export function PhotosAuthShell({
}}
presentationConfig={photosAuthTheme}
contentWidth={contentWidth}
+ viewportHeight={
+ isDesktop
+ ? "calc(100svh - env(titlebar-area-height, 30px))"
+ : undefined
+ }
>
{children}
</AuthPageShell>
diff --git a/web/packages/accounts/components/auth/AuthPageShell.tsx b/web/packages/accounts/components/auth/AuthPageShell.tsx
index 2736efdafa..e4b520c52a 100644
--- a/web/packages/accounts/components/auth/AuthPageShell.tsx
+++ b/web/packages/accounts/components/auth/AuthPageShell.tsx
@@ -21,6 +21,7 @@ export interface AuthPageShellProps extends React.PropsWithChildren {
brand: AuthBrandCopy;
presentationConfig: AuthPresentationConfig;
contentWidth?: 400 | 420;
+ viewportHeight?: string;
}
export function AuthPageShell({
@@ -28,9 +29,10 @@ export function AuthPageShell({
presentationConfig,
children,
contentWidth = 400,
+ viewportHeight = "100svh",
}: AuthPageShellProps): React.JSX.Element {
return (
- <PageRoot>
+ <PageRoot $viewportHeight={viewportHeight}>
<GlobalStyles
styles={createAuthColorVariables(presentationConfig)}
/>
@@ -163,10 +165,12 @@ function BrandPanel({
);
}
-const PageRoot = styled("main")(({ theme }) => ({
+const PageRoot = styled("main", {
+ shouldForwardProp: (prop) => prop !== "$viewportHeight",
+})<{ $viewportHeight: string }>(({ theme, $viewportHeight }) => ({
width: "100%",
- height: "100svh",
- minHeight: "100svh",
+ height: $viewportHeight,
+ minHeight: $viewportHeight,
display: "flex",
position: "relative",
overflow: "hidden",