Skip to main content

ResetPasswordDialog

Overview of ResetPasswordDialog component

ResetPasswordDialog is a modal component used to enter and confirm a new password after OTP verification has been successfully completed.

Props

PropTypeDescription
visiblebooleanControls dialog visibility.
onClosefunctionCallback when dialog is closed.
handleResetPasswordSubmitfunctionHandles submission of new password.
newPasswordstringNew password entered by the user.
setNewPasswordfunctionSetter for newPassword.
confirmPasswordstringConfirmation of the new password.
setConfirmPasswordfunctionSetter for confirmPassword.
triggerToastbooleanWhether to show toast/notification on success/failure.
setTriggerToastfunctionSetter for triggerToast.

Behavior

  • Validates if new and confirm passwords match.
  • Submits data when the user clicks reset.
  • Includes a cancel option that closes the dialog.

Example Usage

<ResetPasswordDialog
visible={showResetPasswordDialog}
onClose={() => setShowResetPasswordDialog(false)}
handleResetPasswordSubmit={handleResetPasswordSubmit}
newPassword={newPassword}
setNewPassword={setNewPassword}
confirmPassword={confirmPassword}
setConfirmPassword={setConfirmPassword}
triggerToast={triggerToast}
setTriggerToast={setTriggerToast}
/>