|
|
|
|
@ -5,38 +5,157 @@ |
|
|
|
|
// import { TournamentsBlock } from './components/TournamentsBlock'
|
|
|
|
|
import { HeaderActions, CloseButton } from 'features/PopupComponents' |
|
|
|
|
import { T9n } from 'features/T9n' |
|
|
|
|
import { TournamentInfo } from 'features/PreferencesPopup/components/TournamentInfo' |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
Modal, |
|
|
|
|
Wrapper, |
|
|
|
|
Header, |
|
|
|
|
HeaderTitle, |
|
|
|
|
// Body,
|
|
|
|
|
Body, |
|
|
|
|
// Footer,
|
|
|
|
|
// ApplyButton,
|
|
|
|
|
} from 'features/PreferencesPopup/styled' |
|
|
|
|
|
|
|
|
|
import { Tournaments } from 'requests/getSportTournaments' |
|
|
|
|
|
|
|
|
|
import { ScItem, ScTournament, ScTournamentList } from './styled' |
|
|
|
|
|
|
|
|
|
import { useTournamentsPopup } from './hooks' |
|
|
|
|
|
|
|
|
|
export const TournamentsPopup = () => { |
|
|
|
|
const { closePopup, isOpen } = useTournamentsPopup() |
|
|
|
|
const { close, isOpen } = useTournamentsPopup() |
|
|
|
|
|
|
|
|
|
const tournaments: Tournaments = [ |
|
|
|
|
{ |
|
|
|
|
country: { |
|
|
|
|
id: 231, |
|
|
|
|
name_eng: 'Czech Republic', |
|
|
|
|
name_rus: 'Чешская Республика', |
|
|
|
|
}, |
|
|
|
|
gender: null, |
|
|
|
|
id: 227, |
|
|
|
|
name_eng: 'MOL Cup', |
|
|
|
|
name_rus: 'MOL CUP', |
|
|
|
|
short_name_eng: null, |
|
|
|
|
short_name_rus: null, |
|
|
|
|
sport: 1, |
|
|
|
|
tournament_type: 1, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
country: { |
|
|
|
|
id: 231, |
|
|
|
|
name_eng: 'Czech Republic', |
|
|
|
|
name_rus: 'Чешская Республика', |
|
|
|
|
}, |
|
|
|
|
gender: null, |
|
|
|
|
id: 946, |
|
|
|
|
name_eng: 'ženskyfotbal', |
|
|
|
|
name_rus: 'ženskyfotbal', |
|
|
|
|
short_name_eng: null, |
|
|
|
|
short_name_rus: null, |
|
|
|
|
sport: 1, |
|
|
|
|
tournament_type: 1, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
country: { |
|
|
|
|
id: 231, |
|
|
|
|
name_eng: 'Czech Republic', |
|
|
|
|
name_rus: 'Чешская Республика', |
|
|
|
|
}, |
|
|
|
|
gender: null, |
|
|
|
|
id: 3067, |
|
|
|
|
name_eng: 'Futsal', |
|
|
|
|
name_rus: 'Futsal', |
|
|
|
|
short_name_eng: null, |
|
|
|
|
short_name_rus: null, |
|
|
|
|
sport: 1, |
|
|
|
|
tournament_type: 1, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
country: { |
|
|
|
|
id: 231, |
|
|
|
|
name_eng: 'Czech Republic', |
|
|
|
|
name_rus: 'Чешская Республика', |
|
|
|
|
}, |
|
|
|
|
gender: null, |
|
|
|
|
id: 5665, |
|
|
|
|
name_eng: 'FACR', |
|
|
|
|
name_rus: 'FACR', |
|
|
|
|
short_name_eng: null, |
|
|
|
|
short_name_rus: null, |
|
|
|
|
sport: 1, |
|
|
|
|
tournament_type: 1, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
const teams = [ |
|
|
|
|
{ |
|
|
|
|
'Czech Republic': 23, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'A ženy': 2719, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
U21: 528, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
U20: 17018, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
U19: 567, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
WU19: 16306, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
U18: 1189, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
U17: 480, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
WU17: 16920, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
U16: 6032, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
U15: 17624, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
WU15: 114440, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
console.log('isOpen', isOpen) |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Modal |
|
|
|
|
isOpen={isOpen} |
|
|
|
|
close={closePopup} |
|
|
|
|
withCloseButton |
|
|
|
|
> |
|
|
|
|
<Modal isOpen close={close} withCloseButton> |
|
|
|
|
<Wrapper> |
|
|
|
|
<Header> |
|
|
|
|
<HeaderTitle> |
|
|
|
|
<T9n t='my_preferences' /> |
|
|
|
|
<T9n t='my_tournaments' /> |
|
|
|
|
</HeaderTitle> |
|
|
|
|
<HeaderTitle> |
|
|
|
|
<T9n t='my_teams' /> |
|
|
|
|
</HeaderTitle> |
|
|
|
|
<HeaderActions position='right'> |
|
|
|
|
<CloseButton onClick={closePopup} /> |
|
|
|
|
<CloseButton onClick={close} /> |
|
|
|
|
</HeaderActions> |
|
|
|
|
</Header> |
|
|
|
|
<Body> |
|
|
|
|
<ScTournamentList> |
|
|
|
|
{tournaments.map((tournament) => ( |
|
|
|
|
<a href={`/tournaments/${tournament.id}`}> |
|
|
|
|
<ScTournament> |
|
|
|
|
<TournamentInfo isIcon={false} tournament={tournament} /> |
|
|
|
|
</ScTournament> |
|
|
|
|
</a> |
|
|
|
|
))} |
|
|
|
|
</ScTournamentList> |
|
|
|
|
{/* <ScTeamsList>123</ScTeamsList> */} |
|
|
|
|
</Body> |
|
|
|
|
</Wrapper> |
|
|
|
|
</Modal> |
|
|
|
|
) |
|
|
|
|
|