diff --git a/client/src/components/HomePage/HomePage.js b/client/src/components/HomePage/HomePage.js index 9b341c3f47..0d085c92e0 100644 --- a/client/src/components/HomePage/HomePage.js +++ b/client/src/components/HomePage/HomePage.js @@ -13,15 +13,36 @@ function HomePage() { justifyContent: "center", }} > - - - - - + + + - + - + + { setLoading(true); try { - const response = await axios.get(`${SVC_ENDPOINTS.question}/questions/categories/unique`); + const response = await axios.get( + `${SVC_ENDPOINTS.question}/questions/categories/unique` + ); if (response.status === 200) { console.log(response.data.map((x) => x.category)); - setQuestionCategories(Array.from(response.data.map((x) => x.category)).sort()); + setQuestionCategories( + Array.from(response.data.map((x) => x.category)).sort() + ); } } catch (error) { console.log(error); @@ -108,7 +111,9 @@ function QueueCard() { clearInterval(timer); const timerId = setInterval(() => { - setProgress((prevProgress) => (prevProgress <= 0 ? 0 : Math.max(0, prevProgress - 10 / 3))); + setProgress((prevProgress) => + prevProgress <= 0 ? 0 : Math.max(0, prevProgress - 10 / 3) + ); }, 1000); setTimer(timerId); const cookies = new Cookies(); @@ -167,78 +172,118 @@ function QueueCard() { }, [activeStep, questionCategories]); return ( - - - - - {steps.map((label) => ( - - {label} - - ))} - - - - - {activeStep === 0 && ( - + + + {steps.map((label) => ( + + {label} + + ))} + + + + + {activeStep === 0 && ( + + - - - Easy - - - Medium - - - Hard - - - - )} - {activeStep === 1 && ( - - {loading ? ( - - ) : ( - - {questionCategories.map((category, index) => { - return ( - - {category} - - ); - })} - - )} - - )} - {activeStep === 2 && ( - - {queueLoading && ( + + Easy + + + Medium + + + Hard + + + + )} + {activeStep === 1 && ( + + {loading ? ( + + ) : ( + + {questionCategories.map((category, index) => { + return ( + + {category} + + ); + })} + + )} + + )} + {activeStep === 2 && ( + + {queueLoading && ( + + Finding You A Match! :D + + + + + + )} + {!queueLoading && queueState.status === "timeout" && ( + No Match Found! D: + )} + {queueLoading || + (collaborationSocket.connected && ( - Finding You A Match! :D - - - - + Start +

Please end all ongoing session before matching again!

+ ))} + {!queueLoading && + queueState.status === "timeout" && + !collaborationSocket.connected && ( + )} - {!queueLoading && queueState.status === "timeout" && ( - No Match Found! D: - )} - {queueLoading || - (collaborationSocket.connected && ( - - Start -

Please end all ongoing session before matching again!

-
- ))} - {!queueLoading && - queueState.status === "timeout" && - !collaborationSocket.connected && ( + {!queueLoading && + queueState.status !== "timeout" && + !collaborationSocket.connected && ( +
- )} - {!queueLoading && - queueState.status !== "timeout" && - !collaborationSocket.connected && ( -
- -
- )} - - )} - {error && {error}} - - - - {activeStep < steps.length - 1 && } - - - +
+ )} +
+ )} + {error && {error}} +
+ + + {activeStep < steps.length - 1 && ( + + )} + +
); } diff --git a/client/src/components/Login/LoginWrapper.js b/client/src/components/Login/LoginWrapper.js index 4d4b565be6..d27fe3b981 100644 --- a/client/src/components/Login/LoginWrapper.js +++ b/client/src/components/Login/LoginWrapper.js @@ -1,4 +1,4 @@ -import { Grid2, Box, styled, TextField } from "@mui/material"; +import { Grid2, Box, styled, TextField, Stack, Hidden } from "@mui/material"; import { ReactComponent as Background } from "../../assets/background.svg"; import { ReactComponent as Logo } from "../../assets/logo.svg"; @@ -13,7 +13,6 @@ export const LoginBox = styled(Box)({ justifyContent: "space-evenly", minHeight: "580px", minWidth: "455px", - height: "100%", alignItems: "center", backgroundColor: "#E7E2E2", borderRadius: "10px", @@ -21,19 +20,16 @@ export const LoginBox = styled(Box)({ function LoginWrapper({ children }) { return ( - {children} - + @@ -50,7 +46,7 @@ function LoginWrapper({ children }) { - + ); }