Skip to content

Commit d00edf0

Browse files
committed
feat: remove cancel button in match found modal
1 parent 4c4ada9 commit d00edf0

File tree

3 files changed

+58
-58
lines changed

3 files changed

+58
-58
lines changed

apps/frontend/src/app/matching/MatchingModal.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,14 @@ const MatchingModal: React.FC<MatchingModalProps> = ({
103103
matchingState.info.matchedUser
104104
);
105105
localStorage.setItem("collabId", matchingState.info.matchId);
106-
localStorage.setItem("questionDocRefId", matchingState.info.questionDocRefId);
107-
localStorage.setItem("matchedTopics", matchingState.info.matchedTopics.join(","));
106+
localStorage.setItem(
107+
"questionDocRefId",
108+
matchingState.info.questionDocRefId
109+
);
110+
localStorage.setItem(
111+
"matchedTopics",
112+
matchingState.info.matchedTopics.join(",")
113+
);
108114

109115
// Redirect to collaboration page
110116
router.push(`/collaboration/${matchingState.info.matchId}`);
Lines changed: 47 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,55 @@
1-
import React from 'react';
2-
import {
3-
Avatar,
4-
} from 'antd';
5-
import {
6-
UserOutlined,
7-
} from '@ant-design/icons';
8-
import 'typeface-montserrat';
9-
import './styles.scss';
10-
import { handleCancelMatch } from '../handlers';
11-
import { formatTime } from '@/utils/DateTime';
12-
1+
import React from "react";
2+
import { Avatar } from "antd";
3+
import { UserOutlined } from "@ant-design/icons";
4+
import "typeface-montserrat";
5+
import "./styles.scss";
6+
import { handleCancelMatch } from "../handlers";
7+
import { formatTime } from "@/utils/DateTime";
138

149
interface Props {
15-
cancel(): void
16-
name1: string, // user's username
17-
name2: string, // matched user's username
10+
cancel(): void;
11+
name1: string; // user's username
12+
name2: string; // matched user's username
1813
}
1914

20-
const JoinedMatchContent: React.FC<Props> = ({cancel, name1: me, name2: you}) => {
21-
const matchAlreadyJoined = () => {
22-
throw new Error('Match already joined.');
23-
}
15+
const JoinedMatchContent: React.FC<Props> = ({
16+
cancel,
17+
name1: me,
18+
name2: you,
19+
}) => {
20+
const matchAlreadyJoined = () => {
21+
throw new Error("Match already joined.");
22+
};
2423

25-
return (
26-
<div className="joined-match-content">
27-
<div className="matched-profiles">
28-
<div className="avatar-caption-container">
29-
<Avatar size={64} icon={<UserOutlined />} />
30-
<div className="user-caption">{me}</div>
31-
</div>
32-
<svg xmlns="http://www.w3.org/2000/svg"
33-
height="24px"
34-
viewBox="0 -960 960 960"
35-
width="24px"
36-
fill="#e8eaed"
37-
className="bolt-icon"
38-
>
39-
<path d="m422-232 207-248H469l29-227-185 267h139l-30 208ZM320-80l40-280H160l360-520h80l-40 320h240L400-80h-80Zm151-390Z"/>
40-
</svg>
41-
<div className="avatar-caption-container">
42-
<Avatar size={64} icon={<UserOutlined />} />
43-
<div className="user-caption">{you}</div>
44-
</div>
45-
</div>
46-
<div className="match-status-label">Match Found!</div>
47-
<div className="match-status-message">
48-
Waiting for others... {formatTime(83)}
49-
</div>
50-
<button className="joined-match-deactivated-button"
51-
disabled
52-
>
53-
Joined
54-
</button>
55-
<button className="cancel-match-button"
56-
onClick={cancel}
57-
>
58-
Cancel
59-
</button>
24+
return (
25+
<div className="joined-match-content">
26+
<div className="matched-profiles">
27+
<div className="avatar-caption-container">
28+
<Avatar size={64} icon={<UserOutlined />} />
29+
<div className="user-caption">{me}</div>
6030
</div>
61-
)
62-
}
31+
<svg
32+
xmlns="http://www.w3.org/2000/svg"
33+
height="24px"
34+
viewBox="0 -960 960 960"
35+
width="24px"
36+
fill="#e8eaed"
37+
className="bolt-icon"
38+
>
39+
<path d="m422-232 207-248H469l29-227-185 267h139l-30 208ZM320-80l40-280H160l360-520h80l-40 320h240L400-80h-80Zm151-390Z" />
40+
</svg>
41+
<div className="avatar-caption-container">
42+
<Avatar size={64} icon={<UserOutlined />} />
43+
<div className="user-caption">{you}</div>
44+
</div>
45+
</div>
46+
<div className="match-status-label">Match Found!</div>
47+
<div className="match-status-message">Waiting for others...</div>
48+
<button className="joined-match-deactivated-button" disabled>
49+
Joined
50+
</button>
51+
</div>
52+
);
53+
};
6354

6455
export default JoinedMatchContent;

apps/frontend/src/app/matching/modalContent/MatchFoundContent.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ const MatchFoundContent: React.FC<Props> = ({
5353
<div className="match-status-message">
5454
Joining in... {formatTime(totalSeconds)}
5555
</div>
56+
<button className="join-match-button" onClick={join}>
57+
Join
58+
</button>
5659
</div>
5760
);
5861
};

0 commit comments

Comments
 (0)