fix(auth): hide/show password revealer in auth pages.

fix(expense): auto-adding new lines.
fix(journal): auto-adding new lines.
This commit is contained in:
a.bouhuolia
2021-03-08 14:52:59 +02:00
parent 644b673411
commit c250762962
14 changed files with 220 additions and 213 deletions

View File

@@ -17,6 +17,17 @@ export default function InviteUserFormContent() {
// Formik context.
const { isSubmitting } = useFormikContext();
const [passwordType, setPasswordType] = React.useState('password');
// Handle password revealer changing.
const handlePasswordRevealerChange = React.useCallback(
(shown) => {
const type = shown ? 'text' : 'password';
setPasswordType(type);
},
[setPasswordType],
);
return (
<Form>
<Row>
@@ -74,14 +85,14 @@ export default function InviteUserFormContent() {
{({ form, field, meta: { error, touched } }) => (
<FormGroup
label={<T id={'password'} />}
labelInfo={<PasswordRevealer />}
labelInfo={<PasswordRevealer onChange={handlePasswordRevealerChange} />}
className={'form-group--password has-password-revealer'}
intent={inputIntent({ error, touched })}
helperText={<ErrorMessage name={'password'} />}
>
<InputGroup
lang={true}
// type={shown ? 'text' : 'password'}
type={passwordType}
intent={inputIntent({ error, touched })}
{...field}
/>