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

@@ -2,10 +2,18 @@ import React from 'react';
import { FormattedMessage as T } from 'react-intl';
import ContentLoader from 'react-content-loader';
import { If, Icon } from 'components';
import { saveInvoke } from 'utils';
export function PasswordRevealer({ defaultShown = false, onChange }) {
const [shown, setShown] = React.useState(defaultShown);
const handleClick = () => {
setShown(!shown);
saveInvoke(onChange, !shown);
};
export function PasswordRevealer({ shown, onClick }) {
return (
<span class="password-revealer" onClick={onClick}>
<span class="password-revealer" onClick={handleClick}>
<If condition={shown}>
<Icon icon="eye-slash" />{' '}
<span class="text">