Prevent layout shift

This commit is contained in:
Manav Rathi 2024-11-21 10:43:51 +05:30
parent eb55dad4a9
commit 228bf49eb3
No known key found for this signature in database

View File

@ -19,8 +19,9 @@ export const PasswordStrengthHint: React.FC<PasswordStrengthHintProps> = ({
<Typography
variant="small"
sx={(theme) => ({
marginBlock: "8px 4px",
mt: "8px",
alignSelf: "flex-start",
whiteSpace: "pre",
color:
passwordStrength == "weak"
? theme.colors.danger.A700
@ -31,7 +32,8 @@ export const PasswordStrengthHint: React.FC<PasswordStrengthHintProps> = ({
>
{password
? t("passphrase_strength", { context: passwordStrength })
: ""}
: /* empty space + white-space: pre to prevent layout shift. */
" "}
</Typography>
);
};