diff --git a/webapp/src/components/AddUser.jsx b/webapp/src/components/AddUser.jsx index 3b0ef7b..1e0bb31 100644 --- a/webapp/src/components/AddUser.jsx +++ b/webapp/src/components/AddUser.jsx @@ -40,63 +40,66 @@ const AddUser = () => { }; return ( - - - - Register - - setUsername(e.target.value)} - /> - setEmail(e.target.value)} - /> - setPassword(e.target.value)} - /> - + +

+ Register +

+ setUsername(e.target.value)} + /> + setEmail(e.target.value)} + /> + setPassword(e.target.value)} + /> + setcPassword(e.target.value)} - /> - - + margin="normal" + fullWidth + label="Confirm Password" + type="password" + value={cpassword} + onChange={(e) => setcPassword(e.target.value)} + /> +
+ +
+ Already have an account? Log in here. - - { - error && ( - setError('')} message={`Error: ${error}`} /> - ) - } -
+ + { + error && ( + setError('')} message={`Error: ${error}`} /> + ) + } +
+ + - ); }; diff --git a/webapp/src/components/Game.jsx b/webapp/src/components/Game.jsx index fed60c3..9367d5b 100644 --- a/webapp/src/components/Game.jsx +++ b/webapp/src/components/Game.jsx @@ -35,41 +35,43 @@ const Game = () => { }, [isAuthenticated, navigate]); return ( -
- {isAuthenticated()? (flagGameStarted || cityGameStarted || monumentGameStarted - || touristAttractionGameStarted || foodGameStarted) ?( -
- {flagGameStarted && } - {cityGameStarted && } - {monumentGameStarted && } - {touristAttractionGameStarted && } - {foodGameStarted && } +
+ {isAuthenticated() ? (flagGameStarted || cityGameStarted || monumentGameStarted + || touristAttractionGameStarted || foodGameStarted) ? ( +
+ {flagGameStarted && } + {cityGameStarted && } + {monumentGameStarted && } + {touristAttractionGameStarted && } + {foodGameStarted && }
) : ( -
-

{auth.username}, Let's Play! Guess the...

- - - - - + Food + +
- ):""} + ) : ""}
) }; diff --git a/webapp/src/components/ImgGameReport.jsx b/webapp/src/components/ImgGameReport.jsx index b18c968..eeb6abc 100644 --- a/webapp/src/components/ImgGameReport.jsx +++ b/webapp/src/components/ImgGameReport.jsx @@ -22,7 +22,7 @@ const ImgGameReport = (props) => {
+ class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 md:py-4 md:text-lg md:px-10 transition-transform transform-gpu hover:-translate-y-1 hover:shadow-lg"> Restart Game
@@ -32,7 +32,7 @@ const ImgGameReport = (props) => {
+ class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-indigo-700 bg-indigo-100 hover:bg-indigo-200 md:py-4 md:text-lg md:px-10 transition-transform transform-gpu hover:-translate-y-1 hover:shadow-lg"> See Rankings
@@ -45,7 +45,7 @@ const ImgGameReport = (props) => { {answers.map((answer) => { return ( -
+
Card Preview
diff --git a/webapp/src/components/Login.jsx b/webapp/src/components/Login.jsx index 3428c3c..b960b5f 100644 --- a/webapp/src/components/Login.jsx +++ b/webapp/src/components/Login.jsx @@ -11,7 +11,7 @@ const Login = () => { const [password, setPassword] = useState(''); const [error, setError] = useState(''); const signIn = useSignIn(); - const navigate = useNavigate(); + const navigate = useNavigate(); const [openSnackbar, setOpenSnackbar] = useState(false); const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; @@ -34,7 +34,7 @@ const Login = () => { } })) { // Only if you are using refreshToken feature // Redirect or do-something - navigate('/'); + navigate('/'); //window.location.href = '/'; } else { //Throw error @@ -62,42 +62,45 @@ const Login = () => { }; return ( +
+ +

+ Access WIQ +

+ setUsername(e.target.value)} + /> + - - Log in to WIQ - - setUsername(e.target.value)} - /> - setPassword(e.target.value)} - /> - - - New around here? Create account. - + name="password" + margin="normal" + fullWidth + label="Password" + type="password" + value={password} + onChange={(e) => setPassword(e.target.value)} + /> +
+ +
+ + New around here? Create account. + - - {error && ( - setError('')} message={`Error: ${error}`} /> - )} -
- + + {error && ( + setError('')} message={`Error: ${error}`} /> + )} + +
); }; diff --git a/webapp/src/components/MainPage.jsx b/webapp/src/components/MainPage.jsx index e4ea156..7db41a5 100644 --- a/webapp/src/components/MainPage.jsx +++ b/webapp/src/components/MainPage.jsx @@ -10,31 +10,50 @@ const MainPage = () => { const auth = useAuthUser(); const navigate = useNavigate(); useEffect(() => { - - if(isAuthenticated()===false) { + + if (isAuthenticated() === false) { logged = false; - }else{ + } else { logged = true; - } - + } + } - , [logged]); + , [logged]); return ( -
+
{logged ?
-

Welcome back, {auth.username}!

-
- -
: + +

Welcome back, {auth.username}!

+ + +
+ +
+ +
+
+ +
+ + +
+
+
:
-

Welcome to WIQ, Please log in to play!

- +
}
diff --git a/webapp/src/components/Navbar.jsx b/webapp/src/components/Navbar.jsx index e46f916..b32d636 100644 --- a/webapp/src/components/Navbar.jsx +++ b/webapp/src/components/Navbar.jsx @@ -15,10 +15,10 @@ function Navbar() {
) diff --git a/webapp/src/components/Squads.jsx b/webapp/src/components/Squads.jsx index 119e713..b6d5354 100644 --- a/webapp/src/components/Squads.jsx +++ b/webapp/src/components/Squads.jsx @@ -2,9 +2,9 @@ import React from 'react'; function Squads() { return ( -
-

Squads

-

Coming soon...

+
+

Squads

+

Coming soon...

); } diff --git a/webapp/src/components/ranking/RankingLayout.jsx b/webapp/src/components/ranking/RankingLayout.jsx index 50ffece..f675fe5 100644 --- a/webapp/src/components/ranking/RankingLayout.jsx +++ b/webapp/src/components/ranking/RankingLayout.jsx @@ -6,49 +6,49 @@ const RankingsLayout = () => { const handleFilterClick = (filter) => { setFilter(filter); + } return ( -
-