File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ function Sidebar() {
63
63
const handleMatch = ( ) => {
64
64
if ( ws && difficulty && language ) {
65
65
setShowMatching ( true ) ;
66
+ setShowUnsuccessfulMatch ( false ) ;
66
67
ws . send ( JSON . stringify ( { userId, difficulty, language } ) ) ; // Send to server
67
68
} else {
68
69
alert ( 'Please select a difficulty and language.' ) ;
@@ -111,7 +112,7 @@ function Sidebar() {
111
112
</ Modal >
112
113
113
114
< Modal show = { showUnsuccessfulMatch } onHide = { handleCloseUnsuccessfulMatch } backdrop = "static" className = "custom-modal" centered >
114
- < UnsuccessfulMatch handleClose = { handleCloseUnsuccessfulMatch } />
115
+ < UnsuccessfulMatch handleClose = { handleCloseUnsuccessfulMatch } handleMatch = { handleMatch } />
115
116
</ Modal >
116
117
</ Stack >
117
118
) ;
Original file line number Diff line number Diff line change 1
1
import React , { useState } from 'react' ;
2
2
import CloseButton from 'react-bootstrap/esm/CloseButton' ;
3
3
4
- function UnsuccessfulMatch ( { handleClose } ) {
4
+ function UnsuccessfulMatch ( { handleClose, handleMatch } ) {
5
5
return (
6
6
< div className = "matching-container" >
7
7
< div className = "close-button" onClick = { handleClose } > ✖</ div >
8
8
< div className = "matching-text" >
9
9
< CloseButton className = "close-button" onClick = { handleClose } > </ CloseButton >
10
10
< h2 > Sorry, we are unable to find you a match.</ h2 >
11
- { /* <button className='btn btn-primary btn-sm'>Match me again</button>*/ }
11
+ < button className = 'btn btn-primary btn-sm' onClick = { handleMatch } > Match me again</ button >
12
12
</ div >
13
13
</ div >
14
14
) ;
You can’t perform that action at this time.
0 commit comments