diff --git a/components/SubmitButton.tsx b/components/SubmitButton.tsx index 8a06eac..6ee0a78 100644 --- a/components/SubmitButton.tsx +++ b/components/SubmitButton.tsx @@ -2,11 +2,12 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { IconProp } from "@fortawesome/fontawesome-svg-core"; type Props = { - onClick: Function; + onClick?: Function; icon?: IconProp; label: string; loading: boolean; className?: string; + type?: "button" | "submit" | "reset" | undefined; }; export default function SubmitButton({ @@ -15,20 +16,22 @@ export default function SubmitButton({ label, loading, className, + type, }: Props) { return ( -
{label}
-{label}
+ ); } diff --git a/pages/choose-username.tsx b/pages/choose-username.tsx index 75d6aa0..1b4d9be 100644 --- a/pages/choose-username.tsx +++ b/pages/choose-username.tsx @@ -1,6 +1,6 @@ import SubmitButton from "@/components/SubmitButton"; import { signOut } from "next-auth/react"; -import { useState } from "react"; +import { FormEvent, useState } from "react"; import { toast } from "react-hot-toast"; import { useSession } from "next-auth/react"; import useAccountStore from "@/store/account"; @@ -15,7 +15,9 @@ export default function ChooseUsername() { const { updateAccount, account } = useAccountStore(); - async function submitUsername() { + async function submitUsername(event: FormEvent- Choose a Username (Last step) -
- -- Username +
- Password Recovery -
-- Enter your Email so we can send you a link to recover your account. - Make sure to change your password in the profile settings - afterwards. -
-- You wont get logged in if you haven't created an account yet. -
-- Email +
- Enter your credentials -
- -- Username - {emailEnabled ? " or Email" : undefined} +
); } diff --git a/pages/register.tsx b/pages/register.tsx index c279e97..bd82b2e 100644 --- a/pages/register.tsx +++ b/pages/register.tsx @@ -1,5 +1,5 @@ import Link from "next/link"; -import { useState } from "react"; +import { useState, FormEvent } from "react"; import { toast } from "react-hot-toast"; import SubmitButton from "@/components/SubmitButton"; import { signIn } from "next-auth/react"; @@ -29,7 +29,9 @@ export default function Register() { passwordConfirmation: "", }); - async function registerUser() { + async function registerUser(event: FormEvent- Enter your details -
-- Display Name +