Skip to content

armgit / ente

Public Imported from GitHub
0

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

Prevent layout shift

Manav Rathi51c9094da4fb
diff --git a/web/packages/accounts/components/Login.tsx b/web/packages/accounts/components/Login.tsx
index 6e9d523aa4..8d31b2bc4b 100644
--- a/web/packages/accounts/components/Login.tsx
+++ b/web/packages/accounts/components/Login.tsx
@@ -1,5 +1,4 @@
import log from "@/next/log";
-import { customAPIHost } from "@/next/origins";
import type { AppName } from "@/next/types/app";
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
@@ -68,11 +67,14 @@ export function Login({ appName, signUp, host }: LoginProps) {
<FormPaperFooter>
<Stack gap={4}>
<LinkButton onClick={signUp}>{t("NO_ACCOUNT")}</LinkButton>
- {host && (
- <Typography variant="mini" color="text.faint">
- {host}
- </Typography>
- )}
+
+ <Typography
+ variant="mini"
+ color="text.faint"
+ minHeight={"32px"}
+ >
+ {host ?? "" /* prevent layout shift with a minHeight */}
+ </Typography>
</Stack>
</FormPaperFooter>
</>
diff --git a/web/packages/accounts/components/SignUp.tsx b/web/packages/accounts/components/SignUp.tsx
index 746d92fe12..7d021812d9 100644
--- a/web/packages/accounts/components/SignUp.tsx
+++ b/web/packages/accounts/components/SignUp.tsx
@@ -1,5 +1,4 @@
import log from "@/next/log";
-import { customAPIHost } from "@/next/origins";
import type { AppName } from "@/next/types/app";
import { sendOtt } from "@ente/accounts/api/user";
import { PasswordStrengthHint } from "@ente/accounts/components/PasswordStrength";
@@ -318,11 +317,14 @@ export function SignUp({ router, appName, login, host }: SignUpProps) {
<LinkButton onClick={login}>
{t("ACCOUNT_EXISTS")}
</LinkButton>
- {host && (
- <Typography variant="mini" color="text.faint">
- {host}
- </Typography>
- )}
+
+ <Typography
+ variant="mini"
+ color="text.faint"
+ minHeight={"32px"}
+ >
+ {host ?? "" /* prevent layout shift with a minHeight */}
+ </Typography>
</Stack>
</FormPaperFooter>
</>