diff --git a/src/features/Landings/index.tsx b/src/features/Landings/index.tsx index 03150bde..b8ed0365 100644 --- a/src/features/Landings/index.tsx +++ b/src/features/Landings/index.tsx @@ -37,8 +37,12 @@ import { LogoBackground, TournamentInfoContainer, } from './styled' +import { checkUrlParams } from '../../helpers/parseUrlParams/parseUrlParams' const Landings = () => { + const season = checkUrlParams('season') + const tournamentName = checkUrlParams('tournament') + const { buttonColor, buttonLexic, @@ -46,7 +50,6 @@ const Landings = () => { description, gallery, isInactiveLanding, - isInactiveLandingData, isNonExistLanding, logo, logoInsports, @@ -117,18 +120,18 @@ const Landings = () => { {isInactiveLanding - ? + ? season : }  - {isInactiveLandingData?.season} +   - {isInactiveLandingData?.tournamentsTitle || defaultTournamentName}  + {tournamentName || defaultTournamentName}    - {isInactiveLandingData?.tournamentsTitle || defaultTournamentName}  + {tournamentName || defaultTournamentName}  diff --git a/src/features/MatchPage/store/hooks/index.tsx b/src/features/MatchPage/store/hooks/index.tsx index 30bf93db..1cc963b8 100644 --- a/src/features/MatchPage/store/hooks/index.tsx +++ b/src/features/MatchPage/store/hooks/index.tsx @@ -36,6 +36,7 @@ import { useTabEvents } from './useTabEvents' import { useTeamsStats } from './useTeamsStats' import { useStatsTab } from './useStatsTab' import { usePlayersStats } from './usePlayersStats' +import { useLang } from '../../../LexicsStore/hooks/useLang' type PlayingData = { player: { @@ -82,6 +83,7 @@ export const useMatchPage = () => { paramName: '', playerOrTeamName: '', }) + const { lang } = useLang() const { profileId: matchId, sportType } = usePageParams() @@ -175,7 +177,10 @@ export const useMatchPage = () => { sportType, tournamentId: data?.tournament.id, })) - redirectToUrl(`${PAGES.landing}/default`) + redirectToUrl(` + ${PAGES.landing}/default + ?season=${data?.season.name} + &tournament=${lang === 'ru' ? data?.tournament.name_rus : data?.tournament.name_eng}`) }) }) // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/requests/getMatchInfo.tsx b/src/requests/getMatchInfo.tsx index fc0da889..2e49db4b 100644 --- a/src/requests/getMatchInfo.tsx +++ b/src/requests/getMatchInfo.tsx @@ -28,6 +28,11 @@ export type MatchTournament = { sportType: number, } +export type MatchSeason = { + id: number, + name: string, +} + export type VideoBound = { e: string, h: string, @@ -55,6 +60,7 @@ export type MatchInfo = { has_video: boolean, live: boolean, playbackUrl?: string, + season: MatchSeason, sport: SportInfo, storage: boolean, sub: boolean,