From 4df92be0368f54fb848560ded4f22a87ffadd261 Mon Sep 17 00:00:00 2001 From: Prudent Bird Date: Mon, 29 Jul 2024 22:14:58 +0100 Subject: [PATCH] Revert "add social login team anchor" --- src/app/(auth-routes)/login/page.tsx | 3 +- src/app/(auth-routes)/register/page.tsx | 132 +++++------------------- src/app/(auth-routes)/sign-up/page.tsx | 24 ++--- src/utils/getApiUrl.ts | 11 -- 4 files changed, 40 insertions(+), 130 deletions(-) delete mode 100644 src/utils/getApiUrl.ts diff --git a/src/app/(auth-routes)/login/page.tsx b/src/app/(auth-routes)/login/page.tsx index 6a8bebf22..cd79f013a 100644 --- a/src/app/(auth-routes)/login/page.tsx +++ b/src/app/(auth-routes)/login/page.tsx @@ -110,7 +110,6 @@ const LoginPage = () => { /> Sign in with Google - diff --git a/src/app/(auth-routes)/register/page.tsx b/src/app/(auth-routes)/register/page.tsx index 8d459c7fd..e5845f651 100644 --- a/src/app/(auth-routes)/register/page.tsx +++ b/src/app/(auth-routes)/register/page.tsx @@ -2,13 +2,14 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { DialogContent, DialogTitle } from "@radix-ui/react-dialog"; +import Image from "next/image"; import Link from "next/link"; -import { useEffect, useState } from "react"; +import { useState } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; -import CustomButton from "~/components/common/common-button/common-button"; import { DialogDemo } from "~/components/common/Dialog"; +import { Button } from "~/components/ui/button"; import { Form, FormControl, @@ -23,8 +24,6 @@ import { InputOTPGroup, InputOTPSlot, } from "~/components/ui/input-otp"; -import { useToast } from "~/components/ui/use-toast"; -import { getApiUrl } from "../../../utils/getApiUrl"; const formSchema = z.object({ fullname: z.string().min(2, { @@ -41,26 +40,6 @@ const formSchema = z.object({ type FormData = z.infer; const SignUp = () => { - const [apiUrl, setApiUrl] = useState(""); - const { toast } = useToast(); - - useEffect(() => { - const fetchApiUrl = async () => { - try { - const url = await getApiUrl(); - setApiUrl(url); - } catch { - toast({ - title: "Error", - description: "Failed to fetch API URL", - variant: "destructive", - }); - } - }; - - fetchApiUrl(); - }, [toast]); - const form = useForm({ resolver: zodResolver(formSchema), }); @@ -74,7 +53,7 @@ const SignUp = () => { })(); }; - const handleSubmit = async () => { + const handleSubmit = () => { form.handleSubmit(handleFormSubmit)(); }; @@ -87,72 +66,26 @@ const SignUp = () => {

- - - - - - - } - > - Sign up with Google - - - - - - - - - - - - } - > - Sign up with Facebook - + +
@@ -224,14 +157,9 @@ const SignUp = () => { )} /> - + { ))} - +

Would you rather use email and password? diff --git a/src/app/(auth-routes)/sign-up/page.tsx b/src/app/(auth-routes)/sign-up/page.tsx index d6cc1e7a9..e0865f278 100644 --- a/src/app/(auth-routes)/sign-up/page.tsx +++ b/src/app/(auth-routes)/sign-up/page.tsx @@ -22,19 +22,17 @@ const page = () => { Create an account to get started with us.

- - - +