From 275a110243495a7b120797b1f95f019ab2febd24 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Tue, 9 Jun 2026 12:37:11 +0000 Subject: [PATCH] Restyle registration page for coaching workspace --- frontend/src/pages/register.tsx | 314 ++++++++++++++++++++++++-------- 1 file changed, 241 insertions(+), 73 deletions(-) diff --git a/frontend/src/pages/register.tsx b/frontend/src/pages/register.tsx index 73a3987..124e941 100644 --- a/frontend/src/pages/register.tsx +++ b/frontend/src/pages/register.tsx @@ -1,92 +1,260 @@ import React from 'react'; import type { ReactElement } from 'react'; -import { ToastContainer, toast } from 'react-toastify'; import Head from 'next/head'; -import BaseButton from '../components/BaseButton'; -import CardBox from '../components/CardBox'; -import SectionFullScreen from '../components/SectionFullScreen'; -import LayoutGuest from '../layouts/Guest'; +import Link from 'next/link'; import { Field, Form, Formik } from 'formik'; -import FormField from '../components/FormField'; -import BaseDivider from '../components/BaseDivider'; -import BaseButtons from '../components/BaseButtons'; +import { ToastContainer, toast } from 'react-toastify'; import { useRouter } from 'next/router'; +import axios from 'axios'; +import LayoutGuest from '../layouts/Guest'; import { getPageTitle } from '../config'; -import axios from "axios"; +const ui = { + page: 'bg-[#fffdf9] text-[#19192d]', + banner: + 'bg-gradient-to-r from-[#35b7a5] via-[#95b76e] to-[#c38a25] text-white', + navShell: + 'rounded-full bg-white shadow-[0_18px_60px_rgba(31,31,50,0.08)] ring-1 ring-[#19192d]/5', + ink: 'text-[#19192d]', + muted: 'text-[#72798a]', + accent: 'text-[#35b7a5]', + border: 'border-[#19192d]/10', + button: + 'bg-gradient-to-r from-[#36b39f] to-[#b98624] text-white shadow-[0_18px_45px_rgba(54,179,159,0.24)] transition hover:brightness-105', + card: 'rounded-[1.75rem] border border-[#19192d]/10 bg-white shadow-[0_18px_50px_rgba(31,31,50,0.05)]', + overline: 'text-sm font-bold uppercase tracking-[0.28em] text-[#b17a1e]', + heading: 'font-serif font-semibold tracking-tight text-[#19192d]', +}; + +type RegisterValues = { + email: string; + password: string; + confirm: string; +}; + +function Nav() { + return ( +
+
+ + + C + + Coaching SaaS Workspace + + + + Login + +
+
+ ); +} export default function Register() { - const [loading, setLoading] = React.useState(false); - const router = useRouter(); - const notify = (type, msg) => toast( msg, {type, position: "bottom-center"}); + const [loading, setLoading] = React.useState(false); + const router = useRouter(); + async function handleSubmit(values: RegisterValues) { + if (values.password !== values.confirm) { + toast('Passwords do not match', { + type: 'error', + position: 'bottom-center', + }); + return; + } - const handleSubmit = async (value) => { - setLoading(true) - try { - - const { data: response } = await axios.post('/auth/signup',value); - await router.push('/login') - setLoading(false) - notify('success', 'Please check your email for verification link') - } catch (error) { - setLoading(false) - console.log('error: ', error) - notify('error', 'Something was wrong. Try again') - } - }; + setLoading(true); - return ( - <> - - {getPageTitle('Login')} - + try { + await axios.post('/auth/signup', { + email: values.email, + password: values.password, + }); + toast('Please check your email for verification link', { + type: 'success', + position: 'bottom-center', + }); + await router.push('/login'); + } catch (error) { + console.log('error: ', error); + toast('Something was wrong. Try again', { + type: 'error', + position: 'bottom-center', + }); + } finally { + setLoading(false); + } + } - - - handleSubmit(values)} - > -
- - - - - - - - - - + return ( + <> + + {getPageTitle('Register')} + - +
+
+

+ Still human +

+

+ AI is not a coach. Keep the real relationship at the center. +

+
- - - - - - - - - - - ); +
+ + + + ); } Register.getLayout = function getLayout(page: ReactElement) { - return {page}; + return {page}; };