Skip to content

armgit / ente

Public Imported from GitHub
0

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

Prevent layout shift

Manav Rathi34f3c55573de
diff --git a/web/packages/accounts/components/NewPasswordForm.tsx b/web/packages/accounts/components/NewPasswordForm.tsx
index 3458308d1d..a0be4565f9 100644
--- a/web/packages/accounts/components/NewPasswordForm.tsx
+++ b/web/packages/accounts/components/NewPasswordForm.tsx
@@ -149,7 +149,12 @@ export const NewPasswordForm: React.FC<NewPasswordFormProps> = ({
</LoadingButton>
<Typography
variant="small"
- sx={{ textAlign: "center", mt: 1, color: "text.muted" }}
+ sx={(theme) => ({
+ textAlign: "center",
+ mt: 1,
+ color: "text.muted",
+ minHeight: theme.typography.small.lineHeight,
+ })}
>
{formik.isSubmitting ? t("key_generation_in_progress") : ""}
</Typography>
diff --git a/web/packages/accounts/components/SignUpContents.tsx b/web/packages/accounts/components/SignUpContents.tsx
index 4bf1860ee9..6b3d09d94e 100644
--- a/web/packages/accounts/components/SignUpContents.tsx
+++ b/web/packages/accounts/components/SignUpContents.tsx
@@ -295,9 +295,16 @@ export const SignUpContents: React.FC<SignUpContentsProps> = ({
</LoadingButton>
<Typography
variant="small"
- sx={{ mt: 1, textAlign: "center", color: "text.muted" }}
+ sx={(theme) => ({
+ mt: 1,
+ textAlign: "center",
+ color: "text.muted",
+ // Prevent layout shift by using a minHeight equal to the
+ // lineHeight of the eventual content that'll be shown.
+ minHeight: theme.typography.small.lineHeight,
+ })}
>
- {formik.isSubmitting ? t("key_generation_in_progress") : " "}
+ {formik.isSubmitting ? t("key_generation_in_progress") : ""}
</Typography>
</form>
);