fix: address PR review feedback on password suggestions
Remove redundant tests, rename requirement translations to suggestion for clearer i18n, simplify password input state and requirement display.
This commit is contained in:
41 files changed
+50
-94
No files matched your search
@@ -20,16 +20,15 @@ export const CustomPasswordInput = ({ withPasswordRequirements, ...props }: Cust
|
||||
};
|
||||
|
||||
const WithPasswordRequirements = (props: PasswordInputProps) => {
|
||||
const [internalValue, setInternalValue] = useState("");
|
||||
const password = props.value ?? internalValue;
|
||||
const [password, setPassword] = useState("");
|
||||
|
||||
const onChange = (event: ChangeEvent<HTMLInputElement>) => {
|
||||
setInternalValue(event.currentTarget.value);
|
||||
setPassword(event.currentTarget.value);
|
||||
props.onChange?.(event);
|
||||
};
|
||||
|
||||
return (
|
||||
<PasswordRequirementsPopover password={String(password)}>
|
||||
<PasswordRequirementsPopover password={password}>
|
||||
<PasswordInput {...props} onChange={onChange} />
|
||||
</PasswordRequirementsPopover>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user