@@ -10,11 +10,13 @@ import { useTimer } from "react-timer-hook"
10
10
interface Props {
11
11
join ( ) : void ,
12
12
cancel ( ) : void ,
13
+ name1 : string , // user's username
14
+ name2 : string , // matched user's username
13
15
}
14
16
15
17
const TIMEOUT = 10 ;
16
18
17
- const MatchFoundContent : React . FC < Props > = ( { join, cancel} ) => {
19
+ const MatchFoundContent : React . FC < Props > = ( { join, cancel, name1 : me , name2 : you } ) => {
18
20
const { totalSeconds } = useTimer ( {
19
21
expiryTimestamp : new Date ( Date . now ( ) + 10 * 1000 ) ,
20
22
onExpire : join
@@ -23,7 +25,10 @@ const MatchFoundContent: React.FC<Props> = ({join, cancel}) => {
23
25
return (
24
26
< div className = "matching-found-content" >
25
27
< div className = "matched-profiles" >
26
- < Avatar size = { 64 } icon = { < UserOutlined /> } />
28
+ < div className = "avatar-caption-container" >
29
+ < Avatar size = { 64 } icon = { < UserOutlined /> } />
30
+ < div className = "user-caption" > { me } </ div >
31
+ </ div >
27
32
< svg xmlns = "http://www.w3.org/2000/svg"
28
33
height = "24px"
29
34
viewBox = "0 -960 960 960"
@@ -33,7 +38,10 @@ const MatchFoundContent: React.FC<Props> = ({join, cancel}) => {
33
38
>
34
39
< path d = "m422-232 207-248H469l29-227-185 267h139l-30 208ZM320-80l40-280H160l360-520h80l-40 320h240L400-80h-80Zm151-390Z" />
35
40
</ svg >
36
- < Avatar size = { 64 } icon = { < UserOutlined /> } />
41
+ < div className = "avatar-caption-container" >
42
+ < Avatar size = { 64 } icon = { < UserOutlined /> } />
43
+ < div className = "user-caption" > { you } </ div >
44
+ </ div >
37
45
</ div >
38
46
< div className = "match-status-label" > Match Found!</ div >
39
47
< div className = "match-status-message" >
0 commit comments