From 79ddcf267e8766aa1cec1225c3f2b3c76644444f Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 29 Jul 2024 06:23:28 +0100 Subject: [PATCH 1/3] Fix: on the second social button, change it from 'sign in with google' to 'sign in with facebook' --- src/app/(auth-routes)/register/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/(auth-routes)/register/page.tsx b/src/app/(auth-routes)/register/page.tsx index e5845f651..2f00c4e36 100644 --- a/src/app/(auth-routes)/register/page.tsx +++ b/src/app/(auth-routes)/register/page.tsx @@ -84,7 +84,7 @@ const SignUp = () => { alt="Facebook" className="mr-2" /> - Sign in with Google + Sign in with Facebook
From fcd8435e1efb84ebf8ab636a3a345d870ec6102a Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 29 Jul 2024 06:45:55 +0100 Subject: [PATCH 2/3] Fix: adjust buttons and input fields heights and set max-width of form container --- src/app/(auth-routes)/register/page.tsx | 308 ++++++++++++------------ src/components/ui/input.tsx | 2 +- 2 files changed, 159 insertions(+), 151 deletions(-) diff --git a/src/app/(auth-routes)/register/page.tsx b/src/app/(auth-routes)/register/page.tsx index 2f00c4e36..60b6fdee8 100644 --- a/src/app/(auth-routes)/register/page.tsx +++ b/src/app/(auth-routes)/register/page.tsx @@ -58,161 +58,169 @@ const SignUp = () => { }; return ( -
-
-

Sign Up

-

- Create an account to get started with us. -

-
-
- - -
-
-
- { - event.preventDefault(); - handleSubmit(); - }} - > - ( - -
- Fullname - - - - -
-
- )} +
+
+
+

Sign Up

+

+ Create an account to get started with us. +

+
+
+ + - - +
+
+ + { + event.preventDefault(); + handleSubmit(); + }} + > + ( + +
+ Fullname + + + + +
+
+ )} + /> + ( + +
+ Email + + + + +
+
+ )} + /> + ( + +
+ Password + + + + +
+
+ )} + /> + -
-

- Would you rather use email and password? + Create Account + + + + + Sign Up + +

+

+ Choose your sign-up method: +

+
    +
  • + Use the temporary sign-in code sent to your mail or +
  • +
  • Continue with email and password
  • +
+
+

+ Please paste (or type) your 6-digit code:{" "}

-

- Continue with email and password + + {...[0, 1, 2, 3, 4, 5].map((number_) => ( + + + + ))} + + +

+

+ Would you rather use email and password? +

+

+ Continue with email and password +

+
+

+ We would process your data as set forth in our Terms of Use, + Privacy Policy and Data Processing Agreement

-
-

- We would process your data as set forth in our Terms of Use, - Privacy Policy and Data Processing Agreement -

- - -
-

Already Have An Account?

- - Login - -
- - + + +
+

Already Have An Account?

+ + Login + +
+ + +
); diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx index f9ee190a6..4c9e1e675 100644 --- a/src/components/ui/input.tsx +++ b/src/components/ui/input.tsx @@ -11,7 +11,7 @@ const Input = React.forwardRef( Date: Mon, 29 Jul 2024 09:18:21 +0100 Subject: [PATCH 3/3] Feat: Add register auth --- src/app/(auth-routes)/login/page.tsx | 2 +- src/app/(auth-routes)/register/page.tsx | 29 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/app/(auth-routes)/login/page.tsx b/src/app/(auth-routes)/login/page.tsx index cd79f013a..7d16bad0b 100644 --- a/src/app/(auth-routes)/login/page.tsx +++ b/src/app/(auth-routes)/login/page.tsx @@ -89,7 +89,7 @@ const LoginPage = () => { }, []); return (
-
+

Login diff --git a/src/app/(auth-routes)/register/page.tsx b/src/app/(auth-routes)/register/page.tsx index 60b6fdee8..f3477e044 100644 --- a/src/app/(auth-routes)/register/page.tsx +++ b/src/app/(auth-routes)/register/page.tsx @@ -53,8 +53,37 @@ const SignUp = () => { })(); }; + const [data, setData] = useState(null); const handleSubmit = () => { form.handleSubmit(handleFormSubmit)(); + // useEffect(() => { + const { fullname, email, password } = form.control._formValues; + const names = fullname.split(" "); + const first_name = names[0]; + const last_name = names[1]; + // console.log(form.control._formValues); + async function fetchData() { + const response = await fetch( + `${process.env.NEXT_PUBLIC_API_URL}api/v1/auth/register`, + { + headers: { + "Content-Type": "application/json", + }, + method: "POST", + body: JSON.stringify({ + email, + first_name, + last_name, + password, + }), + }, + ); + const result = await response.json(); + setData(result); + } + + fetchData(); + // // }, []); }; return (