modify change password UI
This commit is contained in:
parent
5bb27b6106
commit
8f9f0091ea
@ -52,7 +52,6 @@ const ChangePasswordPage = ({ onClose }) => {
|
|||||||
oldPassword: data.oldPassword,
|
oldPassword: data.oldPassword,
|
||||||
newPassword: data.newPassword,
|
newPassword: data.newPassword,
|
||||||
};
|
};
|
||||||
console.log(formData);
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
await AuthRepository.changepassword(formData);
|
await AuthRepository.changepassword(formData);
|
||||||
showToast("Your Password changed Successfully", "success");
|
showToast("Your Password changed Successfully", "success");
|
||||||
@ -72,23 +71,20 @@ const ChangePasswordPage = ({ onClose }) => {
|
|||||||
role="dialog"
|
role="dialog"
|
||||||
style={{ display: "flex", backgroundColor: "rgba(0,0,0,0.5)" }}
|
style={{ display: "flex", backgroundColor: "rgba(0,0,0,0.5)" }}
|
||||||
>
|
>
|
||||||
<div
|
<div className="modal-dialog" role="document">
|
||||||
className="modal-dialog"
|
<div className="modal-header">
|
||||||
role="document"
|
{" "}
|
||||||
style={{
|
|
||||||
maxWidth: "600px",
|
|
||||||
width: "100%",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="modal-content p-4 rounded shadow bg-white position-relative">
|
|
||||||
{/* Close Button */}
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn-close position-absolute"
|
class="btn-close"
|
||||||
style={{ top: "30px", right: "25px" }}
|
data-bs-dismiss="modal"
|
||||||
|
style={{ top: "40px", right: "15px" }}
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
onClick={onClose}
|
|
||||||
></button>
|
></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="modal-content p-10 rounded shadow bg-white position-relative">
|
||||||
|
{/* Close Button */}
|
||||||
|
|
||||||
<h5 className="mb-2">Change Password</h5>
|
<h5 className="mb-2">Change Password</h5>
|
||||||
<p className="mb-4" style={{ fontSize: "14px" }}>
|
<p className="mb-4" style={{ fontSize: "14px" }}>
|
||||||
@ -97,7 +93,7 @@ const ChangePasswordPage = ({ onClose }) => {
|
|||||||
|
|
||||||
<form onSubmit={handleSubmit(onChangePassword)}>
|
<form onSubmit={handleSubmit(onChangePassword)}>
|
||||||
{/* Old Password */}
|
{/* Old Password */}
|
||||||
<div className="mb-3">
|
<div className="mb-3 text-start">
|
||||||
<label className="form-label">Old Password</label>
|
<label className="form-label">Old Password</label>
|
||||||
<div className="input-group input-group-merge d-flex align-items-center border rounded px-2">
|
<div className="input-group input-group-merge d-flex align-items-center border rounded px-2">
|
||||||
<input
|
<input
|
||||||
@ -123,75 +119,75 @@ const ChangePasswordPage = ({ onClose }) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="row">
|
{/* <div className="row"> */}
|
||||||
<div className="mb-3 col-md-6">
|
<div className="mb-3 text-start">
|
||||||
<label className="form-label">New Password</label>
|
<label className="form-label">New Password</label>
|
||||||
<div className="input-group input-group-merge d-flex align-items-center border rounded px-2">
|
<div className="input-group input-group-merge d-flex align-items-center border rounded px-2">
|
||||||
<input
|
<input
|
||||||
type={hideNewPass ? "password" : "text"}
|
type={hideNewPass ? "password" : "text"}
|
||||||
className="form-control form-control-sm border-0 shadow-none"
|
className="form-control form-control-sm border-0 shadow-none"
|
||||||
{...register("newPassword")}
|
{...register("newPassword")}
|
||||||
placeholder="············"
|
placeholder="············"
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-link p-0 ms-2"
|
className="btn btn-link p-0 ms-2"
|
||||||
style={{ fontSize: "18px", color: "#6c757d" }}
|
style={{ fontSize: "18px", color: "#6c757d" }}
|
||||||
onClick={() => setHideNewPass(!hideNewPass)}
|
onClick={() => setHideNewPass(!hideNewPass)}
|
||||||
>
|
>
|
||||||
<i
|
<i className={`bx ${hideNewPass ? "bx-hide" : "bx-show"}`} />
|
||||||
className={`bx ${hideNewPass ? "bx-hide" : "bx-show"}`}
|
</button>
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{errors.newPassword && (
|
|
||||||
<div
|
|
||||||
className="danger-text text-start"
|
|
||||||
style={{ fontSize: "12px" }}
|
|
||||||
>
|
|
||||||
{errors.newPassword.message}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
{errors.newPassword && (
|
||||||
{/* Confirm Password */}
|
<div
|
||||||
<div className="mb-3 col-md-6">
|
className="danger-text text-start"
|
||||||
<label className="form-label">Confirm New Password</label>
|
style={{ fontSize: "12px" }}
|
||||||
<div className="input-group input-group-merge d-flex align-items-center border rounded px-2">
|
>
|
||||||
<input
|
{errors.newPassword.message}
|
||||||
type={hideConfirmPass ? "password" : "text"}
|
|
||||||
className="form-control form-control-sm border-0 shadow-none"
|
|
||||||
{...register("confirmPassword")}
|
|
||||||
placeholder="············"
|
|
||||||
style={{ flex: 1 }}
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn btn-link p-0 ms-2"
|
|
||||||
style={{ fontSize: "18px", color: "#6c757d" }}
|
|
||||||
onClick={() => setHideConfirmPass(!hideConfirmPass)}
|
|
||||||
>
|
|
||||||
<i
|
|
||||||
className={`bx ${
|
|
||||||
hideConfirmPass ? "bx-hide" : "bx-show"
|
|
||||||
}`}
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
{errors.confirmPassword && (
|
)}
|
||||||
<div
|
|
||||||
className="danger-text text-start"
|
|
||||||
style={{ fontSize: "12px" }}
|
|
||||||
>
|
|
||||||
{errors.confirmPassword.message}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Confirm Password */}
|
||||||
|
<div className="mb-3 text-start">
|
||||||
|
<label className="form-label">Confirm New Password</label>
|
||||||
|
<div className="input-group input-group-merge d-flex align-items-center border rounded px-2">
|
||||||
|
<input
|
||||||
|
type={hideConfirmPass ? "password" : "text"}
|
||||||
|
className="form-control form-control-sm border-0 shadow-none"
|
||||||
|
{...register("confirmPassword")}
|
||||||
|
placeholder="············"
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-link p-0 ms-2"
|
||||||
|
style={{ fontSize: "18px", color: "#6c757d" }}
|
||||||
|
onClick={() => setHideConfirmPass(!hideConfirmPass)}
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
className={`bx ${hideConfirmPass ? "bx-hide" : "bx-show"}`}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{errors.confirmPassword && (
|
||||||
|
<div
|
||||||
|
className="danger-text text-start"
|
||||||
|
style={{ fontSize: "12px" }}
|
||||||
|
>
|
||||||
|
{errors.confirmPassword.message}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{/* </div> */}
|
||||||
|
<div className="d-flex justify-content-center pt-2">
|
||||||
|
Your password must have at least 8 characters and include a lower
|
||||||
|
case latter, an uppercase letter, a number, and a special
|
||||||
|
character.
|
||||||
|
</div>
|
||||||
{/* Action Buttons */}
|
{/* Action Buttons */}
|
||||||
<div className="d-flex justify-content-end pt-2">
|
<div className="d-flex justify-content-center pt-2">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-primary btn-sm me-2"
|
className="btn btn-primary btn-sm me-2"
|
||||||
@ -208,21 +204,6 @@ const ChangePasswordPage = ({ onClose }) => {
|
|||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-3 text-start ">
|
|
||||||
<p className="p-0 m-0">Password must be:</p>
|
|
||||||
<p className="p-0 m-0">- at least 8 characters long</p>
|
|
||||||
<p className="p-0 m-0">
|
|
||||||
- must contain one uppercase, one lowercase letter, at least one
|
|
||||||
number, at least one special character
|
|
||||||
</p>
|
|
||||||
{/* <p className="p-0 m-0">
|
|
||||||
- must contain at least one lowercase letter
|
|
||||||
</p>
|
|
||||||
<p className="p-0 m-0">- must contain at least one number</p>
|
|
||||||
<p className="p-0 m-0">
|
|
||||||
- must contain at least one special character
|
|
||||||
</p> */}
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user