@@ -14,17 +14,17 @@ import GameStateCodes from '../../config/gameStateCodes';
1414import { TournamentRemainingTimer } from '../tournament/TournamentHeader' ;
1515
1616const getCustomEventTrClassName = ( item , selectedId ) => cn (
17- 'text-dark font-weight-bold cb-custom-event-tr-border' ,
18- {
19- 'cb-gold-place-bg' : item ?. place === 1 ,
20- 'cb-silver-place-bg' : item ?. place === 2 ,
21- 'cb-bronze-place-bg' : item ?. place === 3 ,
22- 'bg-white' : ! item ?. place || item ?. place > 3 ,
23- } ,
24- {
25- 'cb-custom-event-tr-brown-border' : item ?. clanId === selectedId ,
26- } ,
27- ) ;
17+ 'text-dark font-weight-bold cb-custom-event-tr-border' ,
18+ {
19+ 'cb-gold-place-bg' : item ?. place === 1 ,
20+ 'cb-silver-place-bg' : item ?. place === 2 ,
21+ 'cb-bronze-place-bg' : item ?. place === 3 ,
22+ 'bg-white' : ! item ?. place || item ?. place > 3 ,
23+ } ,
24+ {
25+ 'cb-custom-event-tr-brown-border' : item ?. clanId === selectedId ,
26+ } ,
27+ ) ;
2828
2929const tableDataCellClassName = cn (
3030 'p-1 pl-4 my-2 align-middle text-nowrap position-relative cb-custom-event-td border-0' ,
@@ -41,7 +41,7 @@ const TournamentRankingTable = () => {
4141 lastRoundStartedAt,
4242 matchTimeoutSeconds,
4343 ranking,
44- roundTaskIds ,
44+ taskIds ,
4545 roundTimeoutSeconds,
4646 } = useSelector ( tournamentSelector ) ;
4747
@@ -85,35 +85,51 @@ const TournamentRankingTable = () => {
8585 ) : (
8686 < tr className = "cb-custom-event-empty-space-tr" />
8787 ) }
88- < tr className = { getCustomEventTrClassName ( item , currentUserClanId ) } >
88+ < tr
89+ className = { getCustomEventTrClassName ( item , currentUserClanId ) }
90+ >
8991 < td
90- style = { { borderTopLeftRadius : '0.5rem' , borderBottomLeftRadius : '0.5rem' } }
92+ style = { {
93+ borderTopLeftRadius : '0.5rem' ,
94+ borderBottomLeftRadius : '0.5rem' ,
95+ } }
9196 className = { tableDataCellClassName }
9297 >
9398 < div
9499 title = { item ?. name }
95100 className = "cb-custom-event-name"
96101 style = { {
97- textOverflow : 'ellipsis' , overflow : 'hidden' , whiteSpace : 'nowrap' , maxWidth : '13ch' ,
98- } }
102+ textOverflow : 'ellipsis' ,
103+ overflow : 'hidden' ,
104+ whiteSpace : 'nowrap' ,
105+ maxWidth : '13ch' ,
106+ } }
99107 >
100- { item ?. name . slice ( 0 , 9 ) + ( item ?. name . length > 11 ? '...' : '' ) }
108+ { item ?. name . slice ( 0 , 9 )
109+ + ( item ?. name . length > 11 ? '...' : '' ) }
101110 </ div >
102111 </ td >
103112 < td className = { tableDataCellClassName } >
104113 < div
105114 title = { item ?. clan }
106115 className = "cb-custom-event-name"
107116 style = { {
108- textOverflow : 'ellipsis' , overflow : 'hidden' , whiteSpace : 'nowrap' , maxWidth : '15ch' ,
109- } }
117+ textOverflow : 'ellipsis' ,
118+ overflow : 'hidden' ,
119+ whiteSpace : 'nowrap' ,
120+ maxWidth : '15ch' ,
121+ } }
110122 >
111- { item ?. clan ?. slice ( 0 , 9 ) + ( item ?. clan ?. length > 11 ? '...' : '' ) }
123+ { item ?. clan ?. slice ( 0 , 9 )
124+ + ( item ?. clan ?. length > 11 ? '...' : '' ) }
112125 </ div >
113126 </ td >
114127 < td className = { tableDataCellClassName } > { item . score } </ td >
115128 < td
116- style = { { borderTopRightRadius : '0.5rem' , borderBottomRightRadius : '0.5rem' } }
129+ style = { {
130+ borderTopRightRadius : '0.5rem' ,
131+ borderBottomRightRadius : '0.5rem' ,
132+ } }
117133 className = { tableDataCellClassName }
118134 >
119135 { item . place }
@@ -126,22 +142,20 @@ const TournamentRankingTable = () => {
126142 </ div >
127143
128144 < div className = "d-flex justify-content-around align-items-center mt-1" >
129- {
130- ( currentRoundPosition + 1 !== ( roundTaskIds ?. length || 0 )
131- && gameStatus . state !== GameStateCodes . playing
132- && breakState === 'off' ) && (
133- < span className = "font-weight-bold me-3" >
134- { i18next . t ( 'Round ends in ' ) }
135- < TournamentRemainingTimer
136- key = { lastRoundStartedAt }
137- startsAt = { lastRoundStartedAt }
138- duration = { roundTimeoutSeconds || matchTimeoutSeconds }
139- />
140- </ span >
141- )
142- }
145+ { currentRoundPosition + 1 !== ( taskIds ?. length || 0 )
146+ && gameStatus . state !== GameStateCodes . playing
147+ && breakState === 'off' && (
148+ < span className = "font-weight-bold me-3" >
149+ { i18next . t ( 'Round ends in ' ) }
150+ < TournamentRemainingTimer
151+ key = { lastRoundStartedAt }
152+ startsAt = { lastRoundStartedAt }
153+ duration = { roundTimeoutSeconds || matchTimeoutSeconds }
154+ />
155+ </ span >
156+ ) }
143157
144- { ( gameStatus . state !== GameStateCodes . playing && breakState === 'on' ) && (
158+ { gameStatus . state !== GameStateCodes . playing && breakState === 'on' && (
145159 < span className = "font-weight-bold me-3" >
146160 { i18next . t ( 'Next round will start in ' ) }
147161 < TournamentRemainingTimer
@@ -154,13 +168,13 @@ const TournamentRankingTable = () => {
154168 </ div >
155169
156170 < div className = "d-flex justify-content-around align-items-center mt-1" >
157- { roundTaskIds ?. length > 0 && (
171+ { taskIds ?. length > 0 && (
158172 < span className = "font-weight-bold" >
159173 { i18next . t ( 'Task' ) }
160174 { ': ' }
161175 { currentRoundPosition + 1 }
162176 /
163- { roundTaskIds . length }
177+ { taskIds . length }
164178 </ span >
165179 ) }
166180 </ div >
0 commit comments