diff --git a/packages/dashboard/src/components/Form/SelfServiceForm.js b/packages/dashboard/src/components/Form/SelfServiceForm.js index b4d086ad..e0df6ec2 100644 --- a/packages/dashboard/src/components/Form/SelfServiceForm.js +++ b/packages/dashboard/src/components/Form/SelfServiceForm.js @@ -3,7 +3,14 @@ import { useFormik, getIn, setIn } from "formik"; import classnames from "classnames"; import SelfServiceMessages from "./SelfServiceMessages"; -export default function SelfServiceForm({ fieldsConfig, onSubmit, title, validationSchema = null, button = "Submit" }) { +export default function SelfServiceForm({ + fieldsConfig, + onSubmit, + title, + onError, + validationSchema = null, + button = "Submit", +}) { const [messages, setMessages] = React.useState([]); const fields = fieldsConfig.sort((a, b) => (a.position < b.position ? -1 : 1)); const formik = useFormik({ @@ -21,6 +28,9 @@ export default function SelfServiceForm({ fieldsConfig, onSubmit, title, validat const data = await error.response.json(); if (data.message) { + if (typeof onError === "function") { + onError(data.message); + } setMessages((messages) => [...messages, { type: "error", text: data.message }]); } } else { diff --git a/packages/dashboard/src/pages/auth/recovery.js b/packages/dashboard/src/pages/auth/recovery.js index 05f94d85..14ee5778 100644 --- a/packages/dashboard/src/pages/auth/recovery.js +++ b/packages/dashboard/src/pages/auth/recovery.js @@ -23,6 +23,8 @@ export default function Recovery() { useAnonRoute(); // ensure user is not logged in const [success, setSuccess] = React.useState(false); + const [skynetFreeInviteVisible, setSkynetFreeInviteVisible] = React.useState(false); + const isSiaskyNet = typeof window !== "undefined" && window.location.hostname === "account.siasky.net"; const onSubmit = async (values) => { await accountsApi.post("user/recover/request", { @@ -64,6 +66,16 @@ export default function Recovery() { {" "} for a new account
+ {skynetFreeInviteVisible && isSiaskyNet && ( ++ All Siasky.net accounts have been moved to{" "} + + SkynetFree.net + +
+