From 353eda13f019636781e6d6f9969f5d6db0b3dd3a Mon Sep 17 00:00:00 2001 From: hxtree Date: Wed, 21 Feb 2024 14:11:40 +0000 Subject: [PATCH] feat: flesh in signup form Signed-off-by: hxtree --- .../src/components/SignupForm.tsx | 47 +++++++++++++++++++ .../admin-client/src/pages/signup.page.tsx | 19 +------- 2 files changed, 49 insertions(+), 17 deletions(-) create mode 100644 clients/admin-client/src/components/SignupForm.tsx diff --git a/clients/admin-client/src/components/SignupForm.tsx b/clients/admin-client/src/components/SignupForm.tsx new file mode 100644 index 000000000..099e4cd9c --- /dev/null +++ b/clients/admin-client/src/components/SignupForm.tsx @@ -0,0 +1,47 @@ +import { FC, useState } from "react"; +import { FontAwesomeIcon, faArrowRight, TextField, Button } from '@cats-cradle/design-system/dist/main'; +import React from 'react'; + +type TSignupForm = { + title?: string; +}; + +export const SignupForm: FC = ({ title }) => { + const [isLoading, setIsLoading] = useState(false); + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + + async function createUser() { + // Now use the email and password states here + console.log("Email:", email); + console.log("Password:", password); + // await axios.post() + // set isLoading + } + + function onClickHandler(event: React.MouseEvent) { + setIsLoading(true); + createUser(); // Call createUser when the button is clicked + console.log(event); + return; + } + + return ( +
+

Create an account

+
+ {/* Bind the value and onChange to the email state */} + setEmail(e.target.value)} /> +
+
+ {/* Bind the value and onChange to the password state */} + setPassword(e.target.value)} /> +
+
+ +
+
+ ); +}; diff --git a/clients/admin-client/src/pages/signup.page.tsx b/clients/admin-client/src/pages/signup.page.tsx index 76b3c4c1f..d9e176570 100644 --- a/clients/admin-client/src/pages/signup.page.tsx +++ b/clients/admin-client/src/pages/signup.page.tsx @@ -1,11 +1,7 @@ import { Paper, Link, Button, TextField, faArrowRight, FontAwesomeIcon } from '@cats-cradle/design-system/dist/main'; -import React from 'react'; +import { SignupForm } from '../components/SignupForm'; export default function SignupPage() { - function onClickHandler(event: React.MouseEvent){ - console.log(event); - return; - } return (
@@ -21,18 +17,7 @@ export default function SignupPage() {
-
-

Create an account

-
- -
-
- -
-
- -
-
+