|
|
|
|
@ -20,7 +20,7 @@ import { useLexicsStore } from 'features/LexicsStore' |
|
|
|
|
import { useAuthStore } from 'features/AuthStore' |
|
|
|
|
|
|
|
|
|
import { getLandingName, isPastLandingDate } from './helpers' |
|
|
|
|
import { getName, useName } from '../Name' |
|
|
|
|
import { useName } from '../Name' |
|
|
|
|
|
|
|
|
|
export const useLandings = () => { |
|
|
|
|
const [tournamentInfo, setTournamentInfo] = useState<Landing | null>(null) |
|
|
|
|
@ -29,7 +29,7 @@ export const useLandings = () => { |
|
|
|
|
const [nonExistLogoSrc, setNonExistLogoSrc] = useState('') |
|
|
|
|
const [tournamentProfile, setTournamentProfile] = useState<TournamentInfo>(null) |
|
|
|
|
|
|
|
|
|
const { addLexicsConfig, suffix } = useLexicsStore() |
|
|
|
|
const { addLexicsConfig } = useLexicsStore() |
|
|
|
|
const { |
|
|
|
|
landingUrlFrom, |
|
|
|
|
setIsFromLanding, |
|
|
|
|
@ -115,28 +115,6 @@ export const useLandings = () => { |
|
|
|
|
return () => clearInterval(getSliderInterval) |
|
|
|
|
}, [imgCounter, sliderItemId]) |
|
|
|
|
|
|
|
|
|
const isInactiveLandingData = () => { |
|
|
|
|
if (!tournamentInfo?.tournaments || !isInactiveLanding) return null |
|
|
|
|
|
|
|
|
|
const { |
|
|
|
|
season, |
|
|
|
|
tournament_eng, |
|
|
|
|
tournament_rus, |
|
|
|
|
} = tournamentInfo.tournaments[0] |
|
|
|
|
|
|
|
|
|
const currentTournamentsTitle = { |
|
|
|
|
name_eng: tournament_eng, |
|
|
|
|
name_rus: tournament_rus, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const tournamentsTitle = getName({ nameObj: currentTournamentsTitle, suffix }) |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
season, |
|
|
|
|
tournamentsTitle, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const defaultTournamentName = useName(tournamentProfile || {}) |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
@ -146,7 +124,6 @@ export const useLandings = () => { |
|
|
|
|
description, |
|
|
|
|
gallery, |
|
|
|
|
isInactiveLanding, |
|
|
|
|
isInactiveLandingData: isInactiveLandingData(), |
|
|
|
|
isNonExistLanding, |
|
|
|
|
logo: tournamentInfo?.media.logo, |
|
|
|
|
logoInsports: tournamentInfo?.logo_insports, |
|
|
|
|
|