mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user