mirror of
https://github.com/plankanban/planka.git
synced 2025-07-21 14:19:44 +02:00
Add visibility toggle of password input. Closes #2
This commit is contained in:
parent
a11f6260c0
commit
00c7f514ae
25 changed files with 111 additions and 92 deletions
|
@ -1,28 +1,11 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Input as SemanticUIInput } from 'semantic-ui-react';
|
||||
|
||||
import MaskedInput from './MaskedInput';
|
||||
import InputPassword from './InputPassword';
|
||||
import InputMask from './InputMask';
|
||||
|
||||
const Input = React.forwardRef(({ mask, maskChar, ...props }, ref) => {
|
||||
const nextProps = props;
|
||||
const Input = SemanticUIInput;
|
||||
|
||||
if (mask) {
|
||||
nextProps.input = <MaskedInput mask={mask} maskChar={maskChar} />;
|
||||
}
|
||||
Input.Password = InputPassword;
|
||||
Input.Mask = InputMask;
|
||||
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
return <SemanticUIInput {...nextProps} ref={ref} />;
|
||||
});
|
||||
|
||||
Input.propTypes = {
|
||||
mask: PropTypes.string,
|
||||
maskChar: PropTypes.string,
|
||||
};
|
||||
|
||||
Input.defaultProps = {
|
||||
mask: undefined,
|
||||
maskChar: undefined,
|
||||
};
|
||||
|
||||
export default React.memo(Input);
|
||||
export default Input;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue