From 532b5d387617cbe40ed3644e795574425b379430 Mon Sep 17 00:00:00 2001 From: Sahni-Arjun Date: Sun, 6 Mar 2022 21:13:11 -0500 Subject: [PATCH] minor changes --- sports-matcher/src/App.js | 2 + sports-matcher/src/Navbar.js | 2 +- sports-matcher/src/SignIn.js | 109 ++++++++++++++++++----------------- 3 files changed, 59 insertions(+), 54 deletions(-) diff --git a/sports-matcher/src/App.js b/sports-matcher/src/App.js index 04fc368..f6ab87b 100644 --- a/sports-matcher/src/App.js +++ b/sports-matcher/src/App.js @@ -4,6 +4,7 @@ import SignIn from './SignIn'; import SignUp from './SignUp'; import Admin from './Admin'; import Home from './Home'; +import ChatWindow from './ChatWindow'; function App() { return (
@@ -12,6 +13,7 @@ function App() { } /> } /> } /> + } />
); diff --git a/sports-matcher/src/Navbar.js b/sports-matcher/src/Navbar.js index 3b3373c..c9f0fe1 100644 --- a/sports-matcher/src/Navbar.js +++ b/sports-matcher/src/Navbar.js @@ -108,7 +108,7 @@ export default function Navbar() { - + { navigate('/chat-window') }} sx={{ p: 0 }}> diff --git a/sports-matcher/src/SignIn.js b/sports-matcher/src/SignIn.js index a5df9a6..10b9625 100644 --- a/sports-matcher/src/SignIn.js +++ b/sports-matcher/src/SignIn.js @@ -16,60 +16,63 @@ export default function SignIn() { event.preventDefault(); const data = new FormData(event.currentTarget); // eslint-disable-next-line no-console - if(data.get('username') == "admin" && data.get('password') == "admin"){ - navigate('/'); + if (data.get('username') === "admin" && data.get('password') === "admin") { + navigate('/admin'); + } else if (data.get('username') === "user" && data.get('password') === "user") { + navigate('/chat-window') } }; return ( - - - - - - - - Sign in - - - - - - + + + + + + + + Sign in + + + + + + {"Don't have an account?"} - - - - - )} \ No newline at end of file + + + + + ) +} \ No newline at end of file