Skip to content

Commit

Permalink
fix: signup button loader issue without email and password input (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
davinder-github committed Oct 2, 2024
1 parent 059e59c commit d2ca2d1
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/pages/auth/SignUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,28 @@ import { Button } from "../../components/shared";
import { useAuth } from "../../hooks/useAuth";
import { GoogleAuth } from "../../service/MilanApi";
import "./index.scss";
import { zodResolver } from "@hookform/resolvers/zod";
import { AuthSchema } from "../../constants";

const SignUp = () => {
// Auth type state
const [activeAuthType, setActiveAuthType] = useState("individual");

// Form setup
const {
register,
handleSubmit,
formState: { errors },
} = useForm();
} = useForm({
resolver: zodResolver(
activeAuthType === "individual"
? AuthSchema.individualSignUpSchema
: AuthSchema.clubSignUpSchema,
),
});

const navigate = useNavigate();

// Auth type state
const [activeAuthType, setActiveAuthType] = useState("individual");
const authTypeOptions = [
{ value: "individual", label: "Individual (Person)" },
{ value: "club", label: "Organization (Charity/Club/NGO)" },
Expand Down

0 comments on commit d2ca2d1

Please sign in to comment.