diff --git a/package.json b/package.json index 20a5eb1c..d31d1a0e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "storybook": "start-storybook -p 9009 -s public", "build-storybook": "build-storybook -s public", "start:auth": "REACT_APP_TYPE=auth-service react-scripts start", - "test:auth": "REACT_APP_TYPE=auth-service react-scripts test" + "test:auth": "REACT_APP_TYPE=auth-service react-scripts test", + "facr": "REACT_APP_CLIENT=facr react-scripts start" }, "dependencies": { "@stripe/react-stripe-js": "^1.4.0", diff --git a/src/config/lexics/indexLexics.tsx b/src/config/lexics/indexLexics.tsx index c7e04868..79984947 100644 --- a/src/config/lexics/indexLexics.tsx +++ b/src/config/lexics/indexLexics.tsx @@ -72,6 +72,8 @@ const preferencesPopupLexics = { all: 15449, apply: 15117, my_preferences: 15087, + my_teams: 16685, + my_tournaments: 16686, search: 15127, sport_types: 15088, } diff --git a/src/features/Menu/index.tsx b/src/features/Menu/index.tsx index 1999717b..ed40518c 100644 --- a/src/features/Menu/index.tsx +++ b/src/features/Menu/index.tsx @@ -16,7 +16,7 @@ import { export const Menu = () => { const { openPopup } = usePreferencesStore() - const { openTournamentsPopup } = useTournamentsPopup() + const { open } = useTournamentsPopup() const isHomePage = useRouteMatch(PAGES.home)?.isExact return ( @@ -24,7 +24,7 @@ export const Menu = () => { {isMobileDevice && } { isHomePage && !client.disabledPreferences && ( - + ) diff --git a/src/features/TournamentsPopup/hooks.tsx b/src/features/TournamentsPopup/hooks.tsx index 682680fd..c6f527a6 100644 --- a/src/features/TournamentsPopup/hooks.tsx +++ b/src/features/TournamentsPopup/hooks.tsx @@ -1,19 +1,15 @@ -import { useState } from 'react' +import { useToggle } from 'hooks' export const useTournamentsPopup = () => { - const [isOpen, setIsOpen] = useState(false) - - const closePopup = () => { - setIsOpen(false) - } - - const openTournamentsPopup = () => { - setIsOpen(true) - } + const { + close, + isOpen, + open, + } = useToggle() return { - closePopup, + close, isOpen, - openTournamentsPopup, + open, } } diff --git a/src/features/TournamentsPopup/index.tsx b/src/features/TournamentsPopup/index.tsx index dd2eb117..1e05a4b4 100644 --- a/src/features/TournamentsPopup/index.tsx +++ b/src/features/TournamentsPopup/index.tsx @@ -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() -console.log('isOpen', isOpen) + 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 ( - +
- + + + + - +
+ + + {tournaments.map((tournament) => ( + + + + + + ))} + + {/* 123 */} +
) diff --git a/src/features/TournamentsPopup/styled.tsx b/src/features/TournamentsPopup/styled.tsx index f118abc0..0942ec14 100644 --- a/src/features/TournamentsPopup/styled.tsx +++ b/src/features/TournamentsPopup/styled.tsx @@ -4,5 +4,15 @@ import { isMobileDevice } from 'config/userAgent' import { Modal } from 'features/PreferencesPopup/styled' -export const ScModal = styled(Modal)` +export const ScTournamentList = styled.div` +` + +export const ScTournament = styled.div` + margin-top: 15px; +` + +export const ScTeamsList = styled.div` +` + +export const ScItem = styled.li` `