From c6d750044a33fdae1a00975057892ff37b7f506f Mon Sep 17 00:00:00 2001 From: Kirti Kamal Date: Fri, 14 Jun 2024 09:53:46 +0530 Subject: [PATCH 1/2] added PasswordTextField component --- .../Account/SignUp/SignUp.component.js | 17 +++++----- .../UI/FormItems/PasswordTextField.js | 33 +++++++++++++++++++ 2 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 src/components/UI/FormItems/PasswordTextField.js diff --git a/src/components/Account/SignUp/SignUp.component.js b/src/components/Account/SignUp/SignUp.component.js index 002324a9f..0b2e7702b 100644 --- a/src/components/Account/SignUp/SignUp.component.js +++ b/src/components/Account/SignUp/SignUp.component.js @@ -17,6 +17,7 @@ import validationSchema from './validationSchema'; import { signUp } from './SignUp.actions'; import messages from './SignUp.messages'; import './SignUp.css'; +import PasswordTextField from '../../UI/FormItems/PasswordTextField'; export class SignUp extends Component { static propTypes = { @@ -114,18 +115,16 @@ export class SignUp extends Component { error={errors.email} onChange={handleChange} /> - - { + const [isPasswordVisible, setPasswordVisible] = useState(false); + + const togglePasswordVisibility = () => { + setPasswordVisible(!isPasswordVisible); + }; + + return ( + + + {isPasswordVisible ? : } + + + ) + }} + /> + ); +}; + +export default PasswordTextField; From 0a6852f35e57b93f8118fa24f1aa1bcca5375454 Mon Sep 17 00:00:00 2001 From: Kirti Kamal Date: Sat, 15 Jun 2024 10:05:06 +0530 Subject: [PATCH 2/2] added PasswordTextField in login form and also fixed the suggested changes --- src/components/Account/Login/Login.component.js | 3 ++- src/components/Account/SignUp/SignUp.component.js | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/Account/Login/Login.component.js b/src/components/Account/Login/Login.component.js index 8c9886004..adb00be88 100644 --- a/src/components/Account/Login/Login.component.js +++ b/src/components/Account/Login/Login.component.js @@ -19,6 +19,7 @@ import './Login.css'; import InputAdornment from '@material-ui/core/InputAdornment'; import IconButton from '@material-ui/core/IconButton'; import { Visibility, VisibilityOff } from '@material-ui/icons'; +import PasswordTextField from '../../UI/FormItems/PasswordTextField'; export class Login extends Component { static propTypes = { @@ -101,7 +102,7 @@ export class Login extends Component { name="email" onChange={handleChange} /> -