chore: consolidate platform split checks
This commit is contained in:
@@ -16,8 +16,8 @@ export default function PasswordField({
|
||||
onValueChange,
|
||||
saved = false,
|
||||
savedPlaceholder = "••••••••",
|
||||
revealLabel = "Show password",
|
||||
hideLabel = "Hide password",
|
||||
revealLabel = "i18n:govoplan-core.show_password.044b852f",
|
||||
hideLabel = "i18n:govoplan-core.hide_password.e40123b4",
|
||||
placeholder,
|
||||
disabled = false,
|
||||
className = "",
|
||||
@@ -46,19 +46,19 @@ export default function PasswordField({
|
||||
onChange={(event) => {
|
||||
onValueChange(event.target.value);
|
||||
if (!event.target.value) setVisible(false);
|
||||
}}
|
||||
/>
|
||||
{canReveal && (
|
||||
<button
|
||||
type="button"
|
||||
className="password-field-toggle"
|
||||
aria-label={visible ? hideLabel : revealLabel}
|
||||
title={visible ? hideLabel : revealLabel}
|
||||
onClick={() => setVisible((current) => !current)}
|
||||
>
|
||||
}} />
|
||||
|
||||
{canReveal &&
|
||||
<button
|
||||
type="button"
|
||||
className="password-field-toggle"
|
||||
aria-label={visible ? hideLabel : revealLabel}
|
||||
title={visible ? hideLabel : revealLabel}
|
||||
onClick={() => setVisible((current) => !current)}>
|
||||
|
||||
{visible ? <EyeOff size={17} aria-hidden="true" /> : <Eye size={17} aria-hidden="true" />}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
</div>);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user