import React from "react"; import Image from "next/image"; import { useRouter } from "next/router"; // services import authenticationService from "services/authentication.service"; // hooks import useUserAuth from "hooks/use-user-auth"; import useToast from "hooks/use-toast"; // layouts import DefaultLayout from "layouts/default-layout"; // components import { EmailPasswordForm } from "components/account"; // images import Logo from "public/logo.png"; // types import type { NextPage } from "next"; type EmailPasswordFormValues = { email: string; password?: string; medium?: string; }; const SignUp: NextPage = () => { const router = useRouter(); const { setToastAlert } = useToast(); const { mutateUser } = useUserAuth("sign-in"); const handleSignUp = async (formData: EmailPasswordFormValues) => { const payload = { email: formData.email, password: formData.password ?? "", }; await authenticationService .emailSignUp(payload) .then(async (response) => { setToastAlert({ type: "success", title: "Success!", message: "Account created successfully.", }); if (response) await mutateUser(); router.push("/"); }) .catch((err) => setToastAlert({ type: "error", title: "Error!", message: err?.error || "Something went wrong. Please try again later or contact the support team.", }) ); }; return (
Plane Web Logo
Create a new Plane Account
); }; export default SignUp;