-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d897a8
commit 92e7168
Showing
4 changed files
with
52 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { resetPassword } from "@lib/api"; | ||
import Swal from "sweetalert2"; | ||
|
||
const onResetPassword = (user: any) => { | ||
resetPassword(user.email) | ||
.then((_) => | ||
Swal.fire({ | ||
icon: "success", | ||
title: "Password Reset", | ||
text: "An email has been sent to your account for you to recover your password!", | ||
}) | ||
) | ||
.catch((_) => { | ||
Swal.fire({ | ||
icon: "error", | ||
title: "Oops...", | ||
text: "Something went wrong!", | ||
}); | ||
}); | ||
}; | ||
|
||
export default function ResetPassword(user) { | ||
return ( | ||
<button | ||
className="inline-block h-auto pl-6 pb-5 text-quinary underline" | ||
onClick={(e) => { | ||
e.preventDefault(); | ||
onResetPassword(user); | ||
}} | ||
> | ||
Reset Password | ||
</button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters