Hide recovery key when re-entering it while creating or changing it (#30499)

* Hide recovery key when asked to re-enter it when creating or changing key

* Use align-self to centre the eye icon

Co-authored-by: R Midhun Suresh <hi@midhun.dev>

* Use CSS vars for padding

Co-authored-by: R Midhun Suresh <hi@midhun.dev>

* Use CSS classes to avoid needing the highly specific rule

* Use a Compound variable for border width

* Add classes to snapshots

* Update screenshots

---------

Co-authored-by: R Midhun Suresh <hi@midhun.dev>
This commit is contained in:
Andy Balaam
2025-08-14 15:02:10 +00:00
committed by GitHub
co-authored by R Midhun Suresh
parent 0c498a66b1
commit 362c7d2aac
6 changed files with 99 additions and 22 deletions
@@ -13,9 +13,9 @@ import {
Field,
IconButton,
Label,
PasswordControl,
Root,
Text,
TextControl,
} from "@vector-im/compound-web";
import CopyIcon from "@vector-im/compound-design-tokens/assets/web/icons/copy";
import KeyIcon from "@vector-im/compound-design-tokens/assets/web/icons/key-solid";
@@ -350,7 +350,11 @@ function KeyForm({ onCancelClick, onSubmit, recoveryKey, submitButtonLabel }: Ke
<Field name="recoveryKey" serverInvalid={isKeyInvalidAndFilled}>
<Label>{_t("settings|encryption|recovery|enter_recovery_key")}</Label>
<TextControl required={true} />
<PasswordControl
required={true}
title={_t("settings|encryption|recovery|enter_recovery_key")}
className="mx_KeyForm_password mx_no_textinput"
/>
{isKeyInvalidAndFilled && (
<ErrorMessage>{_t("settings|encryption|recovery|enter_key_error")}</ErrorMessage>
)}