From 848d588bf4fcd1d5ae644edab9fd269a62d48216 Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Fri, 23 Feb 2024 20:02:08 +0000 Subject: [PATCH 1/3] Fix Homepage Buttons Loading Slow --- frontend-next/src/app/page.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend-next/src/app/page.js b/frontend-next/src/app/page.js index ba257bf..87cc7d7 100644 --- a/frontend-next/src/app/page.js +++ b/frontend-next/src/app/page.js @@ -4,11 +4,13 @@ import { useState, useEffect } from 'react' function Home() { const [statusCode, setData] = useState(null) + const [isLoading, setLoading] = useState(true) useEffect(() => { fetch('/api/user') .then((res) => res.status) .then((status) => { setData(status) + setLoading(false) }) }, []) return ( @@ -20,7 +22,7 @@ function Home() { Chat with friends!
- {statusCode == 203 && + {(statusCode == 203 || isLoading) &&
From 199c283b0ee3c00e6d084de2e4738e8f22e69ca4 Mon Sep 17 00:00:00 2001 From: Sgoodridge96 <157318827+Sgoodridge96@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:37:34 -0500 Subject: [PATCH 2/3] Update page.js Updated errors from pull request: Added a password confirmation to register page --- frontend-next/src/app/register/page.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend-next/src/app/register/page.js b/frontend-next/src/app/register/page.js index 0d0291f..df17003 100644 --- a/frontend-next/src/app/register/page.js +++ b/frontend-next/src/app/register/page.js @@ -2,8 +2,7 @@ import { useRouter } from "next/navigation"; import { useForm, Form } from "react-hook-form"; import "../globals.css" -import { useState } from "react"; -import { data } from "autoprefixer"; + function Register() { var { register, control, setError, handleSubmit, formState: { errors } } = useForm() @@ -46,7 +45,7 @@ function Register() { >

-
+
{passwordMismatch &&

Passwords do not match

}
@@ -59,4 +58,4 @@ function Register() { ) } -export default Register; \ No newline at end of file +export default Register; From 151de4ebfdc527f4b07b8954b598a2ef6f3b81ee Mon Sep 17 00:00:00 2001 From: Stephen Date: Mon, 26 Feb 2024 14:22:04 -0500 Subject: [PATCH 3/3] updated register page for password confirmation: Fixed bugs with last PR --- frontend-next/src/app/register/page.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend-next/src/app/register/page.js b/frontend-next/src/app/register/page.js index df17003..620ec6e 100644 --- a/frontend-next/src/app/register/page.js +++ b/frontend-next/src/app/register/page.js @@ -2,6 +2,7 @@ import { useRouter } from "next/navigation"; import { useForm, Form } from "react-hook-form"; import "../globals.css" +import React, {useState} from 'react'; function Register() {