|
|
|
|
@ -18,13 +18,12 @@ import { checkUrlParams, getAllUrlParams } from 'helpers/parseUrlParams/parseUrl |
|
|
|
|
import { usePageParams } from 'hooks/usePageParams' |
|
|
|
|
|
|
|
|
|
import { useName } from 'features/Name' |
|
|
|
|
import { useAuthStore } from 'features/AuthStore' |
|
|
|
|
|
|
|
|
|
import { isPermittedTournament } from '../../helpers/isPermittedTournament' |
|
|
|
|
import { useProfileCard } from '../ProfileCard/hooks' |
|
|
|
|
import { useBuyMatchPopupStore } from '../BuyMatchPopup' |
|
|
|
|
import { MATCH_CONFIG } from '../BuyMatchPopup/store/hooks/useSubscriptions' |
|
|
|
|
import { prepareMatchProfile } from '../MatchPage/helpers/prepareMatchProfile' |
|
|
|
|
import { useAuthStore } from '../AuthStore' |
|
|
|
|
|
|
|
|
|
export const useTournamentPage = () => { |
|
|
|
|
const [tournamentProfile, setTournamentProfile] = useState<TournamentInfo>(null) |
|
|
|
|
@ -32,6 +31,7 @@ export const useTournamentPage = () => { |
|
|
|
|
const { open: openBuyMatchPopup } = useBuyMatchPopupStore() |
|
|
|
|
const country = useName(tournamentProfile?.country || {}) |
|
|
|
|
const history = useHistory() |
|
|
|
|
|
|
|
|
|
const { user } = useAuthStore() |
|
|
|
|
|
|
|
|
|
const { isFavorite, toggleFavorites } = useProfileCard() |
|
|
|
|
@ -77,7 +77,7 @@ export const useTournamentPage = () => { |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if ((checkUrlParams('subscribe') |
|
|
|
|
&& getAllUrlParams('id'))) { |
|
|
|
|
&& getAllUrlParams('id'))) { |
|
|
|
|
getMatchInfo(MATCH_CONFIG.sportId, MATCH_CONFIG.matchId) |
|
|
|
|
.then((match: MatchInfo) => { |
|
|
|
|
const matchProfile = match && prepareMatchProfile({ |
|
|
|
|
|