more enhancements to loading and error feedback
This commit is contained in:
@@ -27,11 +27,11 @@ const NPEDFields = () => {
|
||||
rearId: "NPED",
|
||||
};
|
||||
|
||||
const handleSubmit = (values: NPEDFieldType) => {
|
||||
const handleSubmit = async (values: NPEDFieldType) => {
|
||||
const valuesToSend = {
|
||||
...values,
|
||||
};
|
||||
signIn(valuesToSend);
|
||||
await signIn(valuesToSend);
|
||||
};
|
||||
|
||||
const validateValues = (values: NPEDFieldType) => {
|
||||
@@ -54,7 +54,7 @@ const NPEDFields = () => {
|
||||
validate={validateValues}
|
||||
enableReinitialize
|
||||
>
|
||||
{({ errors, touched }) => (
|
||||
{({ errors, touched, isSubmitting }) => (
|
||||
<Form className="flex flex-col space-y-5 px-2">
|
||||
<FormGroup>
|
||||
<label htmlFor="username">Username</label>
|
||||
@@ -112,7 +112,7 @@ const NPEDFields = () => {
|
||||
type="submit"
|
||||
className="w-1/4 text-white bg-green-700 hover:bg-green-800 font-small rounded-lg text-sm px-2 py-2.5 hover:cursor-pointer"
|
||||
>
|
||||
Login
|
||||
{isSubmitting ? "Logging in..." : "Login"}
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user