From 815f8a23b65124619f234c958ff2e3370e8e57ec Mon Sep 17 00:00:00 2001 From: Saranya-jena Date: Thu, 6 Aug 2020 17:42:22 +0530 Subject: [PATCH] minor changes Signed-off-by: Saranya-jena --- .../AccountsTab/AccountSettings/index.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/litmus-portal/frontend/src/components/AccountsTab/AccountSettings/index.tsx b/litmus-portal/frontend/src/components/AccountsTab/AccountSettings/index.tsx index 4b4a7ff934a..3c90c552e8c 100644 --- a/litmus-portal/frontend/src/components/AccountsTab/AccountSettings/index.tsx +++ b/litmus-portal/frontend/src/components/AccountsTab/AccountSettings/index.tsx @@ -16,7 +16,7 @@ import PersonalDetails from '../PersonalDetails'; import useStyles from './styles'; // used for password field -interface State { +interface Password { password: string; err: boolean; showPassword: boolean; @@ -32,24 +32,24 @@ const AccountSettings: React.FC = () => { ); // states for the three password fields - const [currPassword, setCurrPassword] = React.useState({ + const [currPassword, setCurrPassword] = React.useState({ password: '', showPassword: false, err: false, }); - const [newPassword, setNewPassword] = React.useState({ + const [newPassword, setNewPassword] = React.useState({ password: '', showPassword: false, err: false, }); - const [confNewPassword, setConfNewPassword] = React.useState({ + const [confNewPassword, setConfNewPassword] = React.useState({ password: '', showPassword: false, err: false, }); // handleChange2 handles password validation for second password field - const handleChange2 = (prop: keyof State) => ( + const handleNewPassword = (prop: keyof Password) => ( event: React.ChangeEvent ) => { if ( @@ -71,7 +71,7 @@ const AccountSettings: React.FC = () => { }; // handleChange3 handles password validation for third password field - const handleChange3 = (prop: keyof State) => ( + const handleConfPassword = (prop: keyof Password) => ( event: React.ChangeEvent ) => { if ( @@ -168,7 +168,7 @@ const AccountSettings: React.FC = () => { }`} id="outlined-adornment-password" type={newPassword.showPassword ? 'text' : 'password'} - onChange={handleChange2('password')} + onChange={handleNewPassword('password')} disableUnderline endAdornment={ @@ -201,7 +201,7 @@ const AccountSettings: React.FC = () => { }`} id="outlined-adornment-password" type={confNewPassword.showPassword ? 'text' : 'password'} - onChange={handleChange3('password')} + onChange={handleConfPassword('password')} disableUnderline endAdornment={