Refactor PasswordInput to use type password

(cherry picked from commit c7c1e3ac9e5bffd4d92298fed70916e3808613fd)
This commit is contained in:
Bogdan 2023-12-09 17:21:46 +02:00
parent 3545a7451e
commit 77861e4303
7 changed files with 2 additions and 31 deletions

View file

@ -1,7 +1,5 @@
import PropTypes from 'prop-types';
import React from 'react';
import TextInput from './TextInput';
import styles from './PasswordInput.css';
// Prevent a user from copying (or cutting) the password from the input
function onCopy(e) {
@ -13,17 +11,14 @@ function PasswordInput(props) {
return (
<TextInput
{...props}
type="password"
onCopy={onCopy}
/>
);
}
PasswordInput.propTypes = {
className: PropTypes.string.isRequired
};
PasswordInput.defaultProps = {
className: styles.input
...TextInput.props
};
export default PasswordInput;