diff --git a/components/Forms/Edit/Profile/FormContent/index.tsx b/components/Forms/Edit/Profile/FormContent/index.tsx index a4c86f225..ad26f1087 100644 --- a/components/Forms/Edit/Profile/FormContent/index.tsx +++ b/components/Forms/Edit/Profile/FormContent/index.tsx @@ -24,7 +24,7 @@ export default function FormContent() { const email = `${intl.formatMessage({ id: "Email" })} ${intl.formatMessage({ id: "Address" }).toLowerCase()}` const street = intl.formatMessage({ id: "Address" }) const phoneNumber = intl.formatMessage({ id: "Phone number" }) - const password = intl.formatMessage({ id: "Current password" }) + const currentPassword = intl.formatMessage({ id: "Current password" }) const retypeNewPassword = intl.formatMessage({ id: "Retype new password" }) const zipCode = intl.formatMessage({ id: "Zip code" }) @@ -72,8 +72,10 @@ export default function FormContent() { {intl.formatMessage({ id: "Password" })} - - + + {/* visibilityToggleable set to false as feature is done for signup first */} + {/* likely we can remove the prop altogether once signup launches */} + { diff --git a/components/TempDesignSystem/Form/NewPassword/index.tsx b/components/TempDesignSystem/Form/NewPassword/index.tsx index 070a282af..2c0a6d31a 100644 --- a/components/TempDesignSystem/Form/NewPassword/index.tsx +++ b/components/TempDesignSystem/Form/NewPassword/index.tsx @@ -30,10 +30,11 @@ export default function NewPassword({ placeholder = "", registerOptions = {}, label, + visibilityToggleable = true, }: NewPasswordProps) { const { control } = useFormContext() const intl = useIntl() - const [isPasswordVisible, setPasswordVisible] = useState(false) + const [isPasswordVisible, setIsPasswordVisible] = useState(false) function getErrorMessage(key: PasswordValidatorKey) { switch (key) { @@ -69,7 +70,9 @@ export default function NewPassword({ onChange={field.onChange} validationBehavior="aria" value={field.value} - type={isPasswordVisible ? "text" : "password"} + type={ + visibilityToggleable && isPasswordVisible ? "text" : "password" + } >
- + {visibilityToggleable ? ( + + ) : null}
{field.value ? (
diff --git a/components/TempDesignSystem/Form/NewPassword/newPassword.ts b/components/TempDesignSystem/Form/NewPassword/newPassword.ts index e6835cb58..8486a44ad 100644 --- a/components/TempDesignSystem/Form/NewPassword/newPassword.ts +++ b/components/TempDesignSystem/Form/NewPassword/newPassword.ts @@ -4,6 +4,7 @@ export interface NewPasswordProps extends React.InputHTMLAttributes { label?: string registerOptions?: RegisterOptions + visibilityToggleable?: boolean } export interface IconProps {