|
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"; |
13 | 8 |
|
14 | 9 | 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 |
18 | 13 | }
|
19 | 14 |
|
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 | + }; |
24 | 23 |
|
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> |
60 | 30 | </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 | +}; |
63 | 54 |
|
64 | 55 | export default JoinedMatchContent;
|
0 commit comments