From 088b77a66b634d99bb05b399a9a376571c639528 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 12 Jun 2023 15:47:42 +0100 Subject: [PATCH] Created a placeholder of the register page --- src/pages/index.tsx | 7 +--- src/pages/login.tsx | 2 - src/pages/register.tsx | 95 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 8 deletions(-) create mode 100644 src/pages/register.tsx diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 952ffdf2..8e3e9aac 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,23 +1,18 @@ /* eslint-disable @next/next/no-img-element */ import Head from "next/head"; -import SingleDatasetChart from "@/components/UserResultChart"; import Navbar from "@/components/Navbar"; -import ProfileCard from "@/components/ProfileCard"; import {BsFileEarmarkText, BsPencil, BsStar, BsBook, BsHeadphones, BsPen, BsMegaphone} from "react-icons/bs"; import {withIronSessionSsr} from "iron-session/next"; import {sessionOptions} from "@/lib/session"; -import {User} from "@/interfaces/user"; import {useEffect, useState} from "react"; import useStats from "@/hooks/useStats"; -import {averageScore, formatModuleTotalStats, totalExams} from "@/utils/stats"; -import {Divider} from "primereact/divider"; +import {averageScore, totalExams} from "@/utils/stats"; import useUser from "@/hooks/useUser"; import Sidebar from "@/components/Sidebar"; import Diagnostic from "@/components/Diagnostic"; import {ToastContainer} from "react-toastify"; import {capitalize} from "lodash"; import {Module} from "@/interfaces"; -import clsx from "clsx"; import ProgressBar from "@/components/Low/ProgressBar"; export const getServerSideProps = withIronSessionSsr(({req, res}) => { diff --git a/src/pages/login.tsx b/src/pages/login.tsx index a4e5bda9..e0de45ea 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -5,8 +5,6 @@ import axios from "axios"; import {FormEvent, useState} from "react"; import Head from "next/head"; import useUser from "@/hooks/useUser"; -import {InputText} from "primereact/inputtext"; -import {Password} from "primereact/password"; import {Divider} from "primereact/divider"; import Button from "@/components/Low/Button"; import {BsArrowRepeat} from "react-icons/bs"; diff --git a/src/pages/register.tsx b/src/pages/register.tsx new file mode 100644 index 00000000..9d2264fe --- /dev/null +++ b/src/pages/register.tsx @@ -0,0 +1,95 @@ +/* eslint-disable @next/next/no-img-element */ +import {ToastContainer} from "react-toastify"; +import {useState} from "react"; +import Head from "next/head"; +import useUser from "@/hooks/useUser"; +import Button from "@/components/Low/Button"; +import {BsArrowRepeat} from "react-icons/bs"; + +export default function Register() { + const [name, setName] = useState(""); + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [confirmPassword, setConfirmPassword] = useState(""); + const [isLoading, setIsLoading] = useState(false); + + const {mutateUser} = useUser({ + redirectTo: "/", + redirectIfFound: true, + }); + + return ( + <> + + Register | IELTS GPT + + + + +
+ +
+
+ People smiling looking at a tablet +
+
+

Create new account

+
+
+ + setName(e.target.value)} + placeholder="Enter your name" + className="px-8 py-6 text-sm font-normal placeholder:text-mti-gray-cool bg-white rounded-full shadow-xl shadow-mti-gray-anti-flash focus:outline-none" + /> +
+
+ + setEmail(e.target.value)} + placeholder="Enter email address" + className="px-8 py-6 text-sm font-normal placeholder:text-mti-gray-cool bg-white rounded-full shadow-xl shadow-mti-gray-anti-flash focus:outline-none" + /> +
+
+ + setPassword(e.target.value)} + placeholder="Enter your password" + className="px-8 py-6 text-sm font-normal placeholder:text-mti-gray-cool bg-white rounded-full shadow-xl shadow-mti-gray-anti-flash focus:outline-none" + /> +
+
+ + setConfirmPassword(e.target.value)} + placeholder="Confirm your password" + className="px-8 py-6 text-sm font-normal placeholder:text-mti-gray-cool bg-white rounded-full shadow-xl shadow-mti-gray-anti-flash focus:outline-none" + /> +
+ +
+ + Sign in instead + +
+
+ + ); +}