|
@@ -1,5 +1,6 @@
|
|
|
import { NextPage } from "next/types";
|
|
import { NextPage } from "next/types";
|
|
|
import { useEffect } from "react";
|
|
import { useEffect } from "react";
|
|
|
|
|
+import FormResponse from "../components/FormResponse";
|
|
|
import Layout from "../components/Layout";
|
|
import Layout from "../components/Layout";
|
|
|
import Spinner from "../components/Spinner";
|
|
import Spinner from "../components/Spinner";
|
|
|
import { useAuth } from "../context/UserContext";
|
|
import { useAuth } from "../context/UserContext";
|
|
@@ -80,16 +81,12 @@ const Settings: NextPage = () => {
|
|
|
<button type="submit" className="form-button" disabled={loading}>
|
|
<button type="submit" className="form-button" disabled={loading}>
|
|
|
{loading ? <Spinner /> : "Save"}
|
|
{loading ? <Spinner /> : "Save"}
|
|
|
</button>
|
|
</button>
|
|
|
- {error && !success && (
|
|
|
|
|
- <div role="alert" className="form-alert-msg">
|
|
|
|
|
- {error.message}
|
|
|
|
|
- </div>
|
|
|
|
|
- )}
|
|
|
|
|
- {success && (
|
|
|
|
|
- <div role="alert" className="form-success-msg">
|
|
|
|
|
- Profile updated correctly
|
|
|
|
|
- </div>
|
|
|
|
|
- )}
|
|
|
|
|
|
|
+ <FormResponse
|
|
|
|
|
+ error={error}
|
|
|
|
|
+ success={success}
|
|
|
|
|
+ loading={loading}
|
|
|
|
|
+ fallbackSuccessMessage="Profile updated correctly"
|
|
|
|
|
+ />
|
|
|
</form>
|
|
</form>
|
|
|
</Layout>
|
|
</Layout>
|
|
|
) : null;
|
|
) : null;
|