-
-
-
-
-
-
-
- Thank you... fantasy football draft, for letting me know that even
- in my fantasies, I am bad at sports.
-
-
Jimmy Fallon
-
+
+
+
+
+
+ Thank you... fantasy football draft, for letting me know that even
+ in my fantasies, I am bad at sports.
+
+
Jimmy Fallon
+
+
+
+
+
+ Register A New Account
+
+
+ If you have an existing account{' '}
+
+ Login!
+
+
-
-
-
- Register A New Account
-
+
+
-
-
+
+
-
+
);
};
export default Register;
-
From 61973e3ff53f7cdb5ce92acbf36c879dabcdd143 Mon Sep 17 00:00:00 2001
From: Cor-Ina <115652409+Cor-Ina@users.noreply.github.com>
Date: Tue, 13 Aug 2024 18:37:48 -0400
Subject: [PATCH 32/42] fix(#273): change label text color
---
components/Label/Label.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/Label/Label.tsx b/components/Label/Label.tsx
index d32417c3..e500f27a 100644
--- a/components/Label/Label.tsx
+++ b/components/Label/Label.tsx
@@ -13,7 +13,7 @@ const labelVariants = cva(
{
variants: {
variant: {
- default: 'text-sm text-zinc-900 cursor-text flex-col gap-1.5',
+ default: 'text-sm text-zinc-300 cursor-text flex-col gap-1.5',
secondary: 'text-base text-zinc-50 cursor-pointer rounded-xl items-center py-4 px-3 border-2 border-zinc-800 peer-aria-checked:border-orange-600 peer-hover:bg-zinc-800 flex gap-2',
}
},
From a3c6480231fe3d818a22b3d35d4023022d956275 Mon Sep 17 00:00:00 2001
From: Cor-Ina <115652409+Cor-Ina@users.noreply.github.com>
Date: Tue, 13 Aug 2024 18:41:12 -0400
Subject: [PATCH 33/42] fix(#273): remove punctuation from LinkCustom
---
app/(main)/register/Register.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/(main)/register/Register.tsx b/app/(main)/register/Register.tsx
index 030c9782..9f65835a 100644
--- a/app/(main)/register/Register.tsx
+++ b/app/(main)/register/Register.tsx
@@ -150,8 +150,9 @@ const Register = (): JSX.Element => {
href="/login"
data-testid="login-link"
>
- Login!
+ Login
+ !
From 2f908569d03087bec0bb5f481a263f04bca64865 Mon Sep 17 00:00:00 2001
From: Cor-Ina <115652409+Cor-Ina@users.noreply.github.com>
Date: Wed, 14 Aug 2024 22:46:48 -0400
Subject: [PATCH 34/42] fix(#273): update variant classes
---
components/Label/Label.test.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/Label/Label.test.tsx b/components/Label/Label.test.tsx
index 7688315e..d8df2d3d 100644
--- a/components/Label/Label.test.tsx
+++ b/components/Label/Label.test.tsx
@@ -4,8 +4,8 @@ import { Label } from './Label';
import { labelVariants } from './labelVariants';
const variantClasses = {
+ default: 'text-sm text-zinc-300 cursor-text flex-col gap-1.5',
secondary: 'text-zinc-50 cursor-pointer rounded-xl items-center py-4 px-3 border-2 border-zinc-800 peer-aria-checked:border-orange-600 peer-hover:bg-zinc-800 flex',
- default: 'text-zinc-900 cursor-text flex-col',
};
describe('Label', () => {
From 2ca6306b3f868d2acfffe2c991e619ad01dfad94 Mon Sep 17 00:00:00 2001
From: Cor-Ina <115652409+Cor-Ina@users.noreply.github.com>
Date: Thu, 19 Sep 2024 08:46:53 -0400
Subject: [PATCH 35/42] fix(#273): Merge changes from develop
---
app/(main)/register/Register.tsx | 54 +++++++++++++---------------
app/(main)/register/page.test.tsx | 1 +
components/LinkCustom/LinkCustom.tsx | 2 +-
3 files changed, 26 insertions(+), 31 deletions(-)
diff --git a/app/(main)/register/Register.tsx b/app/(main)/register/Register.tsx
index 9f65835a..72eece9d 100644
--- a/app/(main)/register/Register.tsx
+++ b/app/(main)/register/Register.tsx
@@ -2,19 +2,9 @@
// Licensed under the MIT License.
'use client';
-import React, { JSX, useEffect } from 'react';
-import { useRouter } from 'next/navigation';
-import { Input } from '@/components/Input/Input';
-import Logo from '@/components/Logo/Logo';
+import { AlertVariants } from '@/components/AlertNotification/Alerts.enum';
import { Button } from '@/components/Button/Button';
-import { registerAccount } from '@/api/apiFunctions';
-import logo from '/public/assets/logo-colored-outline.svg';
-import { useAuthContext } from '@/context/AuthContextProvider';
-import LinkCustom from '@/components/LinkCustom/LinkCustom';
-import { Label } from '@/components/Label/Label';
-import { z } from 'zod';
import { Control, useForm, useWatch, SubmitHandler } from 'react-hook-form';
-import { zodResolver } from '@hookform/resolvers/zod';
import {
Form,
FormControl,
@@ -22,9 +12,20 @@ import {
FormItem,
FormMessage,
} from '../../../components/Form/Form';
+import { Input } from '@/components/Input/Input';
+import { registerAccount } from '@/api/apiFunctions';
import { toast } from 'react-hot-toast';
+import { useAuthContext } from '@/context/AuthContextProvider';
+import { useRouter } from 'next/navigation';
+import { z } from 'zod';
+import { zodResolver } from '@hookform/resolvers/zod';
import Alert from '@/components/AlertNotification/AlertNotification';
-import { AlertVariants } from '@/components/AlertNotification/Alerts.enum';
+import { Label } from '@/components/Label/Label';
+import LinkCustom from '@/components/LinkCustom/LinkCustom';
+import Logo from '@/components/Logo/Logo';
+import logo from '/public/assets/logo-colored-outline.svg';
+import React, { JSX, useEffect } from 'react';
+
const RegisterUserSchema = z
.object({
@@ -60,6 +61,7 @@ const Register = (): JSX.Element => {
if (isSignedIn) {
router.push('/league/all');
}
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [isSignedIn]);
const form = useForm
({
@@ -107,7 +109,6 @@ const Register = (): JSX.Element => {
try {
await registerAccount(data);
await login(data);
- router.push('/league/all');
toast.custom(
{
-
+
Thank you... fantasy football draft, for letting me know that even
in my fantasies, I am bad at sports.
@@ -139,29 +140,23 @@ const Register = (): JSX.Element => {
Jimmy Fallon
+
Register A New Account
-
+
If you have an existing account{' '}
-
- Login
-
- !
+ Login!
-
-
+
-
+
);
};
diff --git a/app/(main)/register/page.test.tsx b/app/(main)/register/page.test.tsx
index 21d3c583..bc2b4f34 100644
--- a/app/(main)/register/page.test.tsx
+++ b/app/(main)/register/page.test.tsx
@@ -5,6 +5,7 @@ import Alert from '@/components/AlertNotification/AlertNotification';
import { AlertVariants } from '@/components/AlertNotification/Alerts.enum';
import { toast } from 'react-hot-toast';
+
const mockLogin = jest.fn();
const mockPush = jest.fn();
diff --git a/components/LinkCustom/LinkCustom.tsx b/components/LinkCustom/LinkCustom.tsx
index a56ed82f..1376e1d2 100644
--- a/components/LinkCustom/LinkCustom.tsx
+++ b/components/LinkCustom/LinkCustom.tsx
@@ -39,5 +39,5 @@ const LinkCustom = ({
);
};
-export { Label };
+export default LinkCustom;
From f79a31c224460668a7fc341e23bedf57649fb2c2 Mon Sep 17 00:00:00 2001
From: Cor-Ina <115652409+Cor-Ina@users.noreply.github.com>
Date: Fri, 18 Oct 2024 10:30:21 -0400
Subject: [PATCH 36/42] Merge 'develop' into corina/a11y-audit-signup-page
---
app/(main)/register/Register.tsx | 107 ++++++++----------
app/(main)/register/page.test.tsx | 6 +-
components/Label/Label.tsx | 19 ++--
.../WeeklyPickButton/WeeklyPickButton.tsx | 2 +-
4 files changed, 61 insertions(+), 73 deletions(-)
diff --git a/app/(main)/register/Register.tsx b/app/(main)/register/Register.tsx
index 72eece9d..44e0f646 100644
--- a/app/(main)/register/Register.tsx
+++ b/app/(main)/register/Register.tsx
@@ -20,12 +20,11 @@ import { useRouter } from 'next/navigation';
import { z } from 'zod';
import { zodResolver } from '@hookform/resolvers/zod';
import Alert from '@/components/AlertNotification/AlertNotification';
-import { Label } from '@/components/Label/Label';
import LinkCustom from '@/components/LinkCustom/LinkCustom';
import Logo from '@/components/Logo/Logo';
import logo from '/public/assets/logo-colored-outline.svg';
-import React, { JSX, useEffect } from 'react';
-
+import React, { JSX, useEffect, useState } from 'react';
+import LoadingSpinner from '@/components/LoadingSpinner/LoadingSpinner';
const RegisterUserSchema = z
.object({
@@ -36,11 +35,11 @@ const RegisterUserSchema = z
password: z
.string()
.min(1, { message: 'Please enter a password' })
- .min(6, { message: 'Password must be at least 6 characters' }),
+ .min(8, { message: 'Password must be at least 8 characters' }),
confirmPassword: z
.string()
.min(1, { message: 'Please confirm your password' })
- .min(6, { message: 'Password must be at least 6 characters' }),
+ .min(8, { message: 'Password must be at least 8 characters' }),
})
.refine((data) => data.password === data.confirmPassword, {
message: "Passwords don't match",
@@ -56,6 +55,7 @@ type RegisterUserSchemaType = z.infer;
const Register = (): JSX.Element => {
const router = useRouter();
const { login, isSignedIn } = useAuthContext();
+ const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
if (isSignedIn) {
@@ -107,6 +107,7 @@ const Register = (): JSX.Element => {
data: RegisterUserSchemaType,
): Promise => {
try {
+ setIsLoading(true);
await registerAccount(data);
await login(data);
toast.custom(
@@ -120,6 +121,8 @@ const Register = (): JSX.Element => {
toast.custom(
,
);
+ } finally {
+ setIsLoading(false);
}
};
@@ -140,7 +143,6 @@ const Register = (): JSX.Element => {
Jimmy Fallon