|
|
|
@ -7,8 +7,6 @@ import { createPortal } from 'react-dom' |
|
|
|
|
|
|
|
|
|
|
|
import { useTour } from '@reactour/tour' |
|
|
|
import { useTour } from '@reactour/tour' |
|
|
|
|
|
|
|
|
|
|
|
import map from 'lodash/map' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import type { PlaylistOption } from 'features/MatchPage/types' |
|
|
|
import type { PlaylistOption } from 'features/MatchPage/types' |
|
|
|
import { useMatchPageStore } from 'features/MatchPage/store' |
|
|
|
import { useMatchPageStore } from 'features/MatchPage/store' |
|
|
|
import { |
|
|
|
import { |
|
|
|
@ -21,15 +19,11 @@ import { Overlay } from 'components/Overlay' |
|
|
|
|
|
|
|
|
|
|
|
import { useEventListener, useModalRoot } from 'hooks' |
|
|
|
import { useEventListener, useModalRoot } from 'hooks' |
|
|
|
|
|
|
|
|
|
|
|
import { AdType } from 'requests' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { isIOS, isMobileDevice } from 'config/userAgent' |
|
|
|
import { isIOS, isMobileDevice } from 'config/userAgent' |
|
|
|
|
|
|
|
|
|
|
|
import { getLocalStorageItem } from 'helpers/getLocalStorage' |
|
|
|
import { getLocalStorageItem } from 'helpers/getLocalStorage' |
|
|
|
|
|
|
|
|
|
|
|
import { MATCH_ADS } from 'components/Ads/types' |
|
|
|
import { MATCH_ADS } from 'components/Ads/types' |
|
|
|
import { MobileAd } from 'components/Ads/components/MobileAd' |
|
|
|
|
|
|
|
import { AdComponent } from 'components/Ads/components/AdComponent' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { Tabs } from './config' |
|
|
|
import { Tabs } from './config' |
|
|
|
import { TabEvents } from './components/TabEvents' |
|
|
|
import { TabEvents } from './components/TabEvents' |
|
|
|
@ -49,6 +43,7 @@ import { |
|
|
|
TabButton, |
|
|
|
TabButton, |
|
|
|
EventsAdsWrapper, |
|
|
|
EventsAdsWrapper, |
|
|
|
} from './styled' |
|
|
|
} from './styled' |
|
|
|
|
|
|
|
import { HeaderAds } from '../../components/Ads' |
|
|
|
|
|
|
|
|
|
|
|
const tabPanes = { |
|
|
|
const tabPanes = { |
|
|
|
[Tabs.WATCH]: TabWatch, |
|
|
|
[Tabs.WATCH]: TabWatch, |
|
|
|
@ -98,6 +93,7 @@ export const MatchSidePlaylists = ({ |
|
|
|
const [hasTabPaneScroll, setTabPaneScroll] = useState(false) |
|
|
|
const [hasTabPaneScroll, setTabPaneScroll] = useState(false) |
|
|
|
|
|
|
|
|
|
|
|
const { PLAYS_TOP, PLAYS_TOP_MOBILE } = MATCH_ADS |
|
|
|
const { PLAYS_TOP, PLAYS_TOP_MOBILE } = MATCH_ADS |
|
|
|
|
|
|
|
const adsPositionId = isMobileDevice ? PLAYS_TOP_MOBILE : PLAYS_TOP |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
const { |
|
|
|
const { |
|
|
|
@ -156,11 +152,7 @@ export const MatchSidePlaylists = ({ |
|
|
|
&& ads |
|
|
|
&& ads |
|
|
|
&& ( |
|
|
|
&& ( |
|
|
|
<EventsAdsWrapper hasScroll={hasTabPaneScroll}> |
|
|
|
<EventsAdsWrapper hasScroll={hasTabPaneScroll}> |
|
|
|
{isMobileDevice |
|
|
|
<HeaderAds ads={ads.filter(({ position }) => position.id === adsPositionId)} /> |
|
|
|
? map(ads?.mobile, (ad: AdType) => ad?.position.id === PLAYS_TOP_MOBILE |
|
|
|
|
|
|
|
&& <MobileAd ad={ad} key={ad.id} />) |
|
|
|
|
|
|
|
: map(ads?.match, (ad: AdType) => ad?.position.id === PLAYS_TOP |
|
|
|
|
|
|
|
&& <AdComponent ad={ad} key={ad.id} />)} |
|
|
|
|
|
|
|
</EventsAdsWrapper> |
|
|
|
</EventsAdsWrapper> |
|
|
|
)} |
|
|
|
)} |
|
|
|
<TabsGroup> |
|
|
|
<TabsGroup> |
|
|
|
|