Added checkbox for accepted terms
This commit is contained in:
@@ -4,9 +4,10 @@ import Input from "@/components/Low/Input";
|
||||
import { User } from "@/interfaces/user";
|
||||
import { sendEmailVerification } from "@/utils/email";
|
||||
import axios from "axios";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { toast } from "react-toastify";
|
||||
import { KeyedMutator } from "swr";
|
||||
import useAcceptedTerms from "@/hooks/useAcceptedTerms";
|
||||
|
||||
interface Props {
|
||||
queryCode?: string;
|
||||
@@ -35,6 +36,7 @@ export default function RegisterIndividual({
|
||||
const [confirmPassword, setConfirmPassword] = useState("");
|
||||
const [code, setCode] = useState(queryCode || "");
|
||||
const [hasCode, setHasCode] = useState<boolean>(!!queryCode);
|
||||
const {acceptedTerms, renderCheckbox} = useAcceptedTerms();
|
||||
|
||||
const onSuccess = () =>
|
||||
toast.success(
|
||||
@@ -146,7 +148,9 @@ export default function RegisterIndividual({
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex w-full flex-col items-start gap-4">
|
||||
{renderCheckbox()}
|
||||
</div>
|
||||
<Button
|
||||
className="w-full lg:mt-8"
|
||||
color="purple"
|
||||
@@ -156,6 +160,7 @@ export default function RegisterIndividual({
|
||||
!name ||
|
||||
!password ||
|
||||
!confirmPassword ||
|
||||
!acceptedTerms ||
|
||||
password !== confirmPassword ||
|
||||
(hasCode ? !code : false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user