Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit b15719a

Browse files
committed
Fix #223 - add modifier on password container
1 parent 4e52ec8 commit b15719a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/input/PasswordInput.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { c } from 'ttag';
33
import PropTypes from 'prop-types';
44
import { Icon } from 'react-components';
55

6-
import { generateUID } from '../../helpers/component';
6+
import { generateUID, classnames } from '../../helpers/component';
77
import useInput from './useInput';
88
import ErrorZone from '../text/ErrorZone';
99

@@ -17,10 +17,14 @@ const PasswordInput = (props) => {
1717
const { className, disabled, error, ...rest } = props;
1818
const { handlers, statusClasses, status } = useInput(props);
1919
const [uid] = useState(generateUID('passwordInput'));
20+
const classNameContainer = classnames([
21+
'relative password-revealer-container',
22+
error && status.isDirty && 'password-revealer-container--invalid'
23+
]);
2024

2125
return (
2226
<>
23-
<span className="relative password-revealer-container">
27+
<span className={classNameContainer}>
2428
<input
2529
className={`pm-field w100 ${className} ${statusClasses}`}
2630
aria-invalid={error && status.isDirty}

0 commit comments

Comments
 (0)