1- import React , { useState , useEffect } from ' react' ;
1+ import React , { useState , useEffect } from " react" ;
22
3- import axios from ' axios' ;
4- import cn from ' classnames' ;
5- import { camelizeKeys } from ' humps' ;
6- import { useDispatch , useSelector } from ' react-redux' ;
3+ import axios from " axios" ;
4+ import cn from " classnames" ;
5+ import { camelizeKeys } from " humps" ;
6+ import { useDispatch , useSelector } from " react-redux" ;
77
8- import { loadNearbyUsers } from ' @/middlewares/Users' ;
8+ import { loadNearbyUsers } from " @/middlewares/Users" ;
99import {
1010 selectDefaultAvatarUrl ,
1111 currentUserIsAdminSelector ,
1212 userByIdSelector ,
13- } from ' @/selectors' ;
13+ } from " @/selectors" ;
1414
15- import i18n from ' ../../../i18n' ;
16- import { actions } from ' ../../slices' ;
15+ import i18n from " ../../../i18n" ;
16+ import { actions } from " ../../slices" ;
1717
18- import CodebattleLeagueDescription from ' ./CodebattleLeagueDescription' ;
19- import TournamentListItem , { activeIcon } from ' ./TournamentListItem' ;
18+ import CodebattleLeagueDescription from " ./CodebattleLeagueDescription" ;
19+ import TournamentListItem , { activeIcon } from " ./TournamentListItem" ;
2020
21- const contestDatesText = ' Season: Oct 16 - Dec 21' ;
21+ const contestDatesText = " Season: Oct 16 - Dec 21" ;
2222
2323const OpponentInfo = ( { id } ) => {
2424 const user = useSelector ( userByIdSelector ( id ) ) ;
@@ -29,34 +29,33 @@ const OpponentInfo = ({ id }) => {
2929 < UserLogo user = { user } size = "25px" />
3030 < span
3131 title = { user ?. name }
32- className = { cn ( ' text-white text-truncate ml-2' , {
33- ' cb-text-skeleton w-100' : ! user ,
32+ className = { cn ( " text-white text-truncate ml-2" , {
33+ " cb-text-skeleton w-100" : ! user ,
3434 } ) }
35- style = { { maxWidth : ' 70px' } }
35+ style = { { maxWidth : " 70px" } }
3636 >
3737 { user ?. name }
3838 </ span >
3939 </ div >
4040 < div className = "d-flex flex-column text-center py-1 w-100" >
4141 < a href = "/hall_of_fame" className = "stat-item py-1 w-100" >
4242 < span
43- className = { cn ( ' stat-value d-block cb-text-danger' , {
44- ' d-inline cb-text-skeleton w-25 mx-auto' : ! user ,
43+ className = { cn ( " stat-value d-block cb-text-danger" , {
44+ " d-inline cb-text-skeleton w-25 mx-auto" : ! user ,
4545 } ) }
4646 >
47- #
48- { user ? user . rank : '' }
47+ #{ user ? user . rank : "" }
4948 </ span >
5049 < span className = "stat-label text-uppercase" > Place</ span >
5150 </ a >
5251 </ div >
5352 < div className = "d-flex flex-column text-center py-1 w-100" >
5453 < span
55- className = { cn ( ' stat-value d-block cb-text-danger' , {
56- ' d-inline cb-text-skeleton w-25 mx-auto' : ! user ,
54+ className = { cn ( " stat-value d-block cb-text-danger" , {
55+ " d-inline cb-text-skeleton w-25 mx-auto" : ! user ,
5756 } ) }
5857 >
59- { user ? user . points : '' }
58+ { user ? user . points : "" }
6059 </ span >
6160 < span className = "stat-label text-uppercase" > Points</ span >
6261 </ div >
@@ -72,7 +71,7 @@ const SeasonNearbyUsers = ({ user, nearbyUsers }) => {
7271 if ( user . points ) {
7372 const abortController = new AbortController ( ) ;
7473
75- const onSuccess = payload => {
74+ const onSuccess = ( payload ) => {
7675 if ( ! abortController . signal . aborted ) {
7776 dispatch ( actions . setNearbyUsers ( payload . data ) ) ;
7877 dispatch ( actions . updateUsers ( payload . data ) ) ;
@@ -110,14 +109,14 @@ const SeasonNearbyUsers = ({ user, nearbyUsers }) => {
110109 < OpponentInfo />
111110 </ >
112111 ) : (
113- nearbyUsers . map ( id => < OpponentInfo id = { id } /> )
112+ nearbyUsers . map ( ( id ) => < OpponentInfo id = { id } /> )
114113 ) }
115114 </ div >
116115 </ div >
117116 ) ;
118117} ;
119118
120- const UserLogo = ( { user, size = ' 70px' } ) => {
119+ const UserLogo = ( { user, size = " 70px" } ) => {
121120 const [ userInfo , setUserInfo ] = useState ( ) ;
122121 const defaultAvatarUrl = useSelector ( selectDefaultAvatarUrl ) ;
123122 const avatarUrl = user ?. avatarUrl || userInfo ?. avatarUrl || defaultAvatarUrl ;
@@ -131,7 +130,7 @@ const UserLogo = ({ user, size = '70px' }) => {
131130 . get ( `/api/v1/user/${ userId } /stats` , {
132131 signal : controller . signal ,
133132 } )
134- . then ( response => {
133+ . then ( ( response ) => {
135134 if ( ! controller . signal . aborted ) {
136135 setUserInfo ( camelizeKeys ( response . data . user ) ) ;
137136 }
@@ -178,7 +177,7 @@ const SeasonProfilePanel = ({
178177 </ span >
179178 </ div >
180179 < div className = "d-flex flex-wrap" >
181- { liveTournaments . map ( tournament => (
180+ { liveTournaments . map ( ( tournament ) => (
182181 < TournamentListItem
183182 isAdmin = { isAdmin }
184183 key = { tournament . id }
@@ -197,7 +196,7 @@ const SeasonProfilePanel = ({
197196 </ span >
198197 </ div >
199198 < div className = "d-flex flex-wrap" >
200- { seasonTournaments . map ( tournament => (
199+ { seasonTournaments . map ( ( tournament ) => (
201200 < TournamentListItem
202201 isAdmin = { isAdmin }
203202 key = { tournament . id }
@@ -217,21 +216,21 @@ const SeasonProfilePanel = ({
217216 type = "button"
218217 className = "btn btn-secondary cb-btn-secondary mx-0 mx-md-2 mx-lg-2 w-100 cb-rounded text-nowrap"
219218 >
220- { i18n . t ( ' Contests History' ) }
219+ { i18n . t ( " Contests History" ) }
221220 </ a >
222221 < a
223222 href = "/schedule#my"
224223 type = "button"
225224 className = "btn btn-secondary cb-btn-secondary mx-0 mx-md-2 mx-lg-2 w-100 cb-rounded text-nowrap"
226225 >
227- { i18n . t ( ' My Tournaments' ) }
226+ { i18n . t ( " My Tournaments" ) }
228227 </ a >
229228 < a
230229 href = "/tournaments"
231230 type = "button"
232231 className = "btn btn-secondary cb-btn-secondary mx-0 mx-md-2 mx-lg-2 w-100 cb-rounded text-nowrap"
233232 >
234- { i18n . t ( ' Create a Tournament' ) }
233+ { i18n . t ( " Create a Tournament" ) }
235234 </ a >
236235 </ div >
237236 </ div >
@@ -243,7 +242,7 @@ const SeasonProfilePanel = ({
243242 < span className = "clan-tag mt-2" > { user . name } </ span >
244243 < span className = "h1 clan-title m-0 text-white text-uppercase" >
245244 Clan
246- { ': ' }
245+ { ": " }
247246 { user . clanId ? (
248247 user . clan
249248 ) : (
@@ -264,8 +263,7 @@ const SeasonProfilePanel = ({
264263 < a href = "/hall_of_fame" className = "stat-item py-1 w-100" >
265264 { user . points ? (
266265 < span className = "stat-value d-block cb-text-success" >
267- #
268- { user . rank }
266+ #{ user . rank }
269267 </ span >
270268 ) : (
271269 < span className = "stat-value d-block cb-text-danger" > #0</ span >
@@ -290,7 +288,7 @@ const SeasonProfilePanel = ({
290288 href = "/hall_of_fame"
291289 className = "text-uppercase stat-label cb-rounded"
292290 >
293- { i18n . t ( ' View Hall of Fame' ) }
291+ { i18n . t ( " View Hall of Fame" ) }
294292 </ a >
295293 </ div >
296294 { controls }
0 commit comments