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
| Prop | Type | Description |
|---|---|---|
visible | boolean | Controls dialog visibility. |
onClose | function | Callback when dialog is closed. |
handleResetPasswordSubmit | function | Handles submission of new password. |
newPassword | string | New password entered by the user. |
setNewPassword | function | Setter for newPassword. |
confirmPassword | string | Confirmation of the new password. |
setConfirmPassword | function | Setter for confirmPassword. |
triggerToast | boolean | Whether to show toast/notification on success/failure. |
setTriggerToast | function | Setter 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}
/>