From 18cc2b31eb978a659a037ead17f41a82750dab2a Mon Sep 17 00:00:00 2001 From: Margarita Date: Tue, 4 Jul 2023 17:58:53 +0300 Subject: [PATCH] feat(in-565): pr fixes --- .../Ads/components/AdComponent/hooks.tsx | 2 +- .../Ads/components/AdComponent/index.tsx | 10 ++++-- .../Ads/components/MobileAd/index.tsx | 12 +++++-- .../Ads/components/MobileAd/styled.tsx | 15 ++++----- src/components/Ads/index.tsx | 2 +- src/components/Ads/types.tsx | 4 ++- src/features/HomePage/index.tsx | 4 +-- src/features/MatchPage/index.tsx | 33 ++++++++----------- src/features/MatchPage/store/hooks/index.tsx | 4 +-- .../components/EventsList/index.tsx | 9 +++-- .../components/MatchPlaylists/index.tsx | 2 +- .../components/TabWatch/index.tsx | 4 +-- src/features/MatchSidePlaylists/index.tsx | 14 ++------ src/features/MatchesGrid/index.tsx | 4 +-- src/features/StreamPlayer/index.tsx | 8 ++--- .../components/TournamentMobile/index.tsx | 8 ++--- src/hooks/index.tsx | 1 + src/hooks/useScreenOrientation.tsx | 14 ++++++++ 18 files changed, 82 insertions(+), 68 deletions(-) create mode 100644 src/hooks/useScreenOrientation.tsx diff --git a/src/components/Ads/components/AdComponent/hooks.tsx b/src/components/Ads/components/AdComponent/hooks.tsx index 04386a4d..de130741 100644 --- a/src/components/Ads/components/AdComponent/hooks.tsx +++ b/src/components/Ads/components/AdComponent/hooks.tsx @@ -70,7 +70,7 @@ export const useAd = ({ ad }: AdComponentType) => { currentAdsTime, ]) - const handleClose = async () => { + const handleClose = () => { setIsOpenAd(false) isMatchPage() && setIsNeedToShow(false) sendBannerClickEvent(EventGA.CLOSE) diff --git a/src/components/Ads/components/AdComponent/index.tsx b/src/components/Ads/components/AdComponent/index.tsx index d5dfd302..790eeb6a 100644 --- a/src/components/Ads/components/AdComponent/index.tsx +++ b/src/components/Ads/components/AdComponent/index.tsx @@ -1,7 +1,10 @@ -import { memo, MouseEvent } from 'react' +import type { MouseEvent } from 'react' +import { memo } from 'react' import type { AdType } from 'requests' +import { useLexicsStore } from 'features/LexicsStore' + import { useAd } from './hooks' import { EventGA } from '../../types' @@ -33,9 +36,11 @@ export const AdComponent = memo(({ ad }: AdComponentType) => { sendBannerClickEvent, } = useAd({ ad }) + const { suffix } = useLexicsStore() + const close = (e: MouseEvent) => { e.stopPropagation() - return handleClose() + handleClose() } const onLinkClick = () => { @@ -76,6 +81,7 @@ export const AdComponent = memo(({ ad }: AdComponentType) => { )} diff --git a/src/components/Ads/components/MobileAd/index.tsx b/src/components/Ads/components/MobileAd/index.tsx index 72726a35..4fc72105 100644 --- a/src/components/Ads/components/MobileAd/index.tsx +++ b/src/components/Ads/components/MobileAd/index.tsx @@ -4,6 +4,8 @@ import includes from 'lodash/includes' import type { AdType } from 'requests' +import { useLexicsStore } from 'features/LexicsStore' + import { useAd } from '../AdComponent/hooks' import { EventGA, PLAYER_MOBILE_FULL_SCREEN } from '../../types' @@ -25,6 +27,8 @@ export const MobileAd = ({ ad }: MobileAdTypes) => { position, } = ad + const { suffix } = useLexicsStore() + const { handleClose, isNeedToShow, @@ -36,7 +40,7 @@ export const MobileAd = ({ ad }: MobileAdTypes) => { const close = (e: MouseEvent) => { e.stopPropagation() - return handleClose() + handleClose() } const onLinkClick = () => { @@ -63,7 +67,11 @@ export const MobileAd = ({ ad }: MobileAdTypes) => { {isVideo ?