Skip to content

Commit 7a7d04d

Browse files
authored
Merge pull request #58 from guanquann/feat/matching-matched
Matched and timeout page
2 parents 0c89965 + aa4e1eb commit 7a7d04d

File tree

7 files changed

+135
-7
lines changed

7 files changed

+135
-7
lines changed

.husky/pre-commit

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
cd ./frontend && npm run lint && npm run test
2-
cd ..
1+
cd ./frontend
2+
npm run lint
3+
npm run test -- --maxWorkers=50%
4+
cd ..
35

4-
cd ./backend/user-service && npm run lint && npm run test
5-
cd ../..
6+
cd ./backend/user-service
7+
npm run lint
8+
npm run test -- --maxWorkers=50%
9+
cd ../..
610

7-
cd ./backend/question-service && npm run lint && npm run test
11+
cd ./backend/question-service
12+
npm run lint
13+
npm run test -- --maxWorkers=50%
14+
cd ../..

frontend/src/App.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import Landing from "./pages/Landing";
1010
import Home from "./pages/Home";
1111
import SignUp from "./pages/SignUp";
1212
import LogIn from "./pages/LogIn";
13+
import Matched from "./pages/Matched";
14+
import Timeout from "./pages/Timeout";
1315
import ProtectedRoutes from "./components/ProtectedRoutes";
1416
import Matching from "./pages/Matching";
1517
import Layout from "./components/Layout";
@@ -43,8 +45,8 @@ function App() {
4345
/>
4446
<Route path="matching" element={<ProtectedRoutes />}>
4547
<Route index element={<Matching />} />
46-
<Route path="matched" element={<div>Matched</div>} />
47-
<Route path="timeout" element={<div>Timeout</div>} />
48+
<Route path="matched" element={<Matched />} />
49+
<Route path="timeout" element={<Timeout />} />
4850
</Route>
4951
<Route path="*" element={<PageNotFound />} />
5052
</Route>

frontend/src/assets/timeout.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.fullheight {
2+
flex: 1;
3+
}
4+
5+
.center {
6+
display: flex;
7+
flex-direction: column;
8+
align-items: center;
9+
justify-content: center;
10+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { useNavigate } from "react-router-dom";
2+
import AppMargin from "../../components/AppMargin";
3+
import { Avatar, Box, Button, Stack, Typography } from "@mui/material";
4+
import classes from "./index.module.css";
5+
6+
const Matched: React.FC = () => {
7+
const navigate = useNavigate();
8+
9+
return (
10+
<AppMargin classname={`${classes.fullheight} ${classes.center}`}>
11+
<Stack spacing={2} alignItems={"center"}>
12+
<Typography variant="h1">It's a match!</Typography>
13+
14+
<Box
15+
display="flex"
16+
alignItems="center"
17+
justifyContent="center"
18+
paddingTop={2}
19+
paddingBottom={2}
20+
>
21+
<Avatar sx={{ width: 120, height: 120 }} />
22+
23+
<Box
24+
sx={(theme) => ({
25+
width: "120px",
26+
height: "2px",
27+
backgroundColor: theme.palette.secondary.contrastText,
28+
margin: "0 10px",
29+
})}
30+
/>
31+
32+
<Avatar sx={{ width: 120, height: 120 }} />
33+
</Box>
34+
35+
<Typography variant="h3">Practice with @john?</Typography>
36+
37+
<Stack spacing={2} direction="row" paddingTop={2} width={700}>
38+
<Button
39+
variant="contained"
40+
color="secondary"
41+
fullWidth
42+
onClick={() => navigate("/matching")}
43+
>
44+
Rematch
45+
</Button>
46+
<Button variant="contained" fullWidth>
47+
Accept
48+
</Button>
49+
</Stack>
50+
</Stack>
51+
</AppMargin>
52+
);
53+
};
54+
55+
export default Matched;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.fullheight {
2+
flex: 1;
3+
}
4+
5+
.center {
6+
display: flex;
7+
flex-direction: column;
8+
align-items: center;
9+
justify-content: center;
10+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { useNavigate } from "react-router-dom";
2+
import AppMargin from "../../components/AppMargin";
3+
import { Button, Stack, Typography } from "@mui/material";
4+
import timeout from "../../assets/timeout.svg";
5+
import classes from "./index.module.css";
6+
7+
const Timeout: React.FC = () => {
8+
const navigate = useNavigate();
9+
10+
return (
11+
<AppMargin classname={`${classes.fullheight} ${classes.center}`}>
12+
<Stack spacing={2} alignItems={"center"}>
13+
<Typography variant="h1">Oops, timeout...</Typography>
14+
15+
<img src={timeout} style={{ height: 240, width: "auto" }} />
16+
17+
<Typography variant="h3">
18+
Unfortunately, we could not find a match.
19+
</Typography>
20+
21+
<Stack spacing={2} direction="row" paddingTop={2} width={700}>
22+
<Button
23+
variant="contained"
24+
color="secondary"
25+
fullWidth
26+
onClick={() => navigate("/questions")}
27+
>
28+
Exit
29+
</Button>
30+
<Button
31+
variant="contained"
32+
fullWidth
33+
onClick={() => navigate("/matching")}
34+
>
35+
Try Again
36+
</Button>
37+
</Stack>
38+
</Stack>
39+
</AppMargin>
40+
);
41+
};
42+
43+
export default Timeout;

0 commit comments

Comments
 (0)