Skip to content

Commit

Permalink
Merge pull request #476 from etn-ccis/fix/4706-change-pw-dialog-props
Browse files Browse the repository at this point in the history
Fix/4706 change pw dialog props
  • Loading branch information
daileytj authored Sep 18, 2023
2 parents 40c45b6 + a4591d4 commit d75c08c
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ export const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props)
const { t } = useLanguageLocale();
const passwordRef = useRef(null);
const confirmRef = useRef(null);
const [currentInput, setCurrentInput] = useState('');
const [passwordInput, setPasswordInput] = useState('');
const [confirmInput, setConfirmInput] = useState('');
const [showErrorDialog, setShowErrorDialog] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [showSuccessScreen, setShowSuccessScreen] = useState(false);
const { actions } = useAuthContext();

const {
open,
Expand All @@ -53,9 +46,18 @@ export const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props)
onFinish,
PasswordProps,
ErrorDialogProps,
loading,
currentPasswordTextFieldProps,
} = props;

const [currentInput, setCurrentInput] = useState('');
const [passwordInput, setPasswordInput] = useState('');
const [confirmInput, setConfirmInput] = useState('');
const [showErrorDialog, setShowErrorDialog] = useState(false);
const [isLoading, setIsLoading] = useState(loading);
const [showSuccessScreen, setShowSuccessScreen] = useState(false);
const { actions } = useAuthContext();

const passwordRequirements = defaultPasswordRequirements(t);

const updateFields = useCallback(
Expand Down Expand Up @@ -133,7 +135,10 @@ export const ChangePasswordDialog: React.FC<ChangePasswordDialogProps> = (props)
currentPasswordLabel={currentPasswordLabel}
previousLabel={previousLabel}
nextLabel={nextLabel}
currentPasswordChange={(currentPwd): void => setCurrentInput(currentPwd)}
currentPasswordChange={(currentPwd): void => {
setCurrentInput(currentPwd);
props?.currentPasswordChange?.(currentPwd);
}}
enableButton={checkPasswords}
onPrevious={onPrevious}
PasswordProps={passwordProps}
Expand Down

0 comments on commit d75c08c

Please sign in to comment.