1- import React , { useEffect , useMemo , useState } from "react" ;
1+ import React , { useEffect , useState } from "react" ;
22import { useDispatch , useSelector } from "react-redux" ;
33
44import Header from "./Header" ;
@@ -11,19 +11,20 @@ import * as selectors from "../../selectors";
1111import Loading from "@/components/Loading" ;
1212import { requestInviteUpdate } from "@/middlewares/GroupTournament" ;
1313
14- function GroupTournamentPage ( ) {
14+ function GroupTournamentPage ( { tournamentId } ) {
1515 const dispatch = useDispatch ( ) ;
1616
1717 const [ showInviteWindow , setShowInviteWindow ] = useState ( false ) ;
1818 const [ runId , setRunId ] = useState ( ) ;
1919
20- useGroupTournamentChannel ( ) ;
20+ useGroupTournamentChannel ( tournamentId ) ;
2121
2222 const {
2323 status,
2424 projectStatus,
2525 projectLink,
2626 invite,
27+ externalSetup,
2728 solutionEvolution,
2829 logs,
2930 code,
@@ -32,56 +33,60 @@ function GroupTournamentPage() {
3233
3334 const openExternalRegistrationWindow = ( ) => {
3435 setShowInviteWindow ( true ) ;
35- }
36+ } ;
3637
3738 const requestInviteUpdates = ( ) => {
3839 requestInviteUpdate ( ) ( dispatch ) ;
39- }
40+ } ;
4041
4142 useEffect ( ( ) => {
4243 if ( runId ) {
4344 console . log ( runId ) ;
4445 }
45- } , [ runId ] )
46+ } , [ runId ] ) ;
4647
4748 useEffect ( ( ) => {
4849 if ( showInviteWindow ) {
4950 open ( invite . inviteLink , undefined , "left=100,top=100,width=960,height=640" ) ;
5051 }
51- } , [ showInviteWindow ] )
52+ } , [ invite . inviteLink , showInviteWindow ] ) ;
5253
53- if ( invite . status === "loading" ) {
54+ if ( invite . state === "loading" ) {
5455 return < Loading /> ;
5556 }
5657
57- if ( invite . status === "creating" || invite . status === "pending" ) {
58- return < >
59- < div className = "container-fluid h-100" >
60- < div className = "row justify-content-center h-100" >
61- < div className = "col-lg-5 col-md-5 col-sm-5 px-md-4 align-content-center" >
62- < div className = "card cb-card border cb-border-color cb-rounded shadow-sm p-5" >
63- < div className = "d-flex" >
64- < button
65- type = "button"
66- className = "btn btn-success text-white cb-rounded w-100"
67- onClick = { openExternalRegistrationWindow }
68- >
69- Registration
70- </ button >
71- < button
72- type = "button"
73- className = "btn btn-secondary cb-rounded w-100 ml-2"
74- onClick = { requestInviteUpdates }
75- >
76- Next Step
77- </ button >
58+ if ( invite . state === "creating" || invite . state === "pending" ) {
59+ return (
60+ < >
61+ < div className = "container-fluid h-100" >
62+ < div className = "row justify-content-center h-100" >
63+ < div className = "col-lg-5 col-md-5 col-sm-5 px-md-4 align-content-center" >
64+ < div className = "card cb-card border cb-border-color cb-rounded shadow-sm p-5" >
65+ < div className = "d-flex" >
66+ < button
67+ type = "button"
68+ className = "btn btn-success text-white cb-rounded w-100"
69+ onClick = { openExternalRegistrationWindow }
70+ >
71+ Registration
72+ </ button >
73+ < button
74+ type = "button"
75+ className = "btn btn-secondary cb-rounded w-100 ml-2"
76+ onClick = { requestInviteUpdates }
77+ >
78+ Next Step
79+ </ button >
80+ </ div >
81+ < small className = "text-center mt-3" >
82+ For this stage you need registrated on a new platform
83+ </ small >
7884 </ div >
79- < small className = "text-center mt-3" > For this stage you need registrated on a new platform</ small >
8085 </ div >
8186 </ div >
8287 </ div >
83- </ div >
84- </ >
88+ </ >
89+ ) ;
8590 }
8691
8792 return (
@@ -94,10 +99,14 @@ function GroupTournamentPage() {
9499 </ div >
95100 < div className = "row mt-1" >
96101 < div className = "col-lg-3 col-md-3 col-12" >
97- < EvolutionPanel items = { solutionEvolution } tournamentStatus = { status } setRunId = { setRunId } />
102+ < EvolutionPanel
103+ items = { solutionEvolution }
104+ tournamentStatus = { status }
105+ setRunId = { setRunId }
106+ />
98107 </ div >
99108 < div className = "col-lg-6 col-md-6 col-12" >
100- < MainPanel status = { status } />
109+ < MainPanel status = { status } externalSetup = { externalSetup } />
101110 </ div >
102111 < div className = "col-lg-3 col-md-3 col-12" >
103112 < EditorPanel text = { code } lang = { langSlug } />
0 commit comments