Revert "fix(#564): add fixes"

This reverts commit e1c8ff491e.
pull/230/head
andreidekterev 3 years ago
parent 36fe1fff03
commit 475126d2dc
  1. 2
      src/components/Ads/components/AdComponent/hooks.tsx
  2. 5
      src/components/Ads/components/AdComponent/index.tsx
  3. 6
      src/components/Ads/components/MobileAd/index.tsx
  4. 4
      src/components/Ads/hooks.tsx
  5. 3
      src/components/Ads/index.tsx
  6. 3
      src/components/Ads/styled.tsx
  7. 5
      src/components/Ads/types.tsx
  8. 10
      src/features/TournamentList/components/TournamentMobile/index.tsx

@ -24,7 +24,7 @@ import {
const countryCode = getLocalStorageItem(COUNTRY) const countryCode = getLocalStorageItem(COUNTRY)
export const useAd = ({ ad }: AdComponentType) => { export const useAd = ({ ad, close: hideElement }: AdComponentType) => {
const [isOpenAd, setIsOpenAd] = useState(true) const [isOpenAd, setIsOpenAd] = useState(true)
const views = getLocalStorageItem(adsViews) as ViewsType const views = getLocalStorageItem(adsViews) as ViewsType
const { const {

@ -14,8 +14,9 @@ import { CloseButton } from '../../../../features/PopupComponents'
export type AdComponentType = { export type AdComponentType = {
ad: AdType, ad: AdType,
close?: () => void,
} }
export const AdComponent = memo(({ ad }: AdComponentType) => { export const AdComponent = memo(({ ad, close }: AdComponentType) => {
const { const {
link, link,
media, media,
@ -29,7 +30,7 @@ export const AdComponent = memo(({ ad }: AdComponentType) => {
isOpenCloseBtn, isOpenCloseBtn,
isVideo, isVideo,
sendBannerClickEvent, sendBannerClickEvent,
} = useAd({ ad }) } = useAd({ ad, close })
return ( return (
position && isOpenAd && isNeedToShow position && isOpenAd && isNeedToShow

@ -1,25 +1,25 @@
import { MouseEvent } from 'react' import { MouseEvent } from 'react'
import type { AdType } from 'requests' import type { AdType } from 'requests'
import { CloseButton } from 'features/PopupComponents' import { CloseButton } from 'features/PopupComponents'
import { import {
Img, Img,
MobileAdWrapper, MobileAdWrapper,
Video, Video,
} from './styled' } from './styled'
import { useAd } from '../AdComponent/hooks' import { useAd } from '../AdComponent/hooks'
import { EventGA } from '../../types' import { EventGA } from '../../types'
type MobileAdTypes = { type MobileAdTypes = {
ad: AdType, ad: AdType,
className?: string, className?: string,
close?: () => void,
} }
export const MobileAd = ({ export const MobileAd = ({
ad, ad,
className, className,
close,
}: MobileAdTypes) => { }: MobileAdTypes) => {
const { const {
link, link,
@ -34,7 +34,7 @@ export const MobileAd = ({
isOpenCloseBtn, isOpenCloseBtn,
isVideo, isVideo,
sendBannerClickEvent, sendBannerClickEvent,
} = useAd({ ad }) } = useAd({ ad, close })
return ( return (
position && isOpenAd && isNeedToShow ? ( position && isOpenAd && isNeedToShow ? (

@ -8,14 +8,12 @@ import { getAds } from 'requests'
import { useLang } from 'features/LexicsStore/hooks/useLang' import { useLang } from 'features/LexicsStore/hooks/useLang'
import { useMemo } from 'react' import { useMemo } from 'react'
import { useAuthStore } from 'features/AuthStore'
import { import {
DeviceType, DeviceType,
PageType, PageType,
} from './types' } from './types'
import { calcMaxAdDurationAds } from './helpers/calcMaxDurationAds' import { calcMaxAdDurationAds } from './helpers/calcMaxDurationAds'
import { useAuthStore } from '../../features/AuthStore'
import { adsStore } from '../../pages/HighlightsPage/storeHighlightsAtoms' import { adsStore } from '../../pages/HighlightsPage/storeHighlightsAtoms'
export const useAds = () => { export const useAds = () => {

@ -1,7 +1,5 @@
import type { AdType } from 'requests' import type { AdType } from 'requests'
import { isMobileDevice } from 'config'
import { import {
HeaderWrapAd, HeaderWrapAd,
} from './styled' } from './styled'
@ -9,6 +7,7 @@ import {
import { AdComponent } from './components/AdComponent' import { AdComponent } from './components/AdComponent'
import { AdsPropsType } from './types' import { AdsPropsType } from './types'
import { MobileAd } from './components/MobileAd' import { MobileAd } from './components/MobileAd'
import { isMobileDevice } from '../../config'
export const HeaderAds = ({ ads }: AdsPropsType) => ( export const HeaderAds = ({ ads }: AdsPropsType) => (
ads?.length ? ( ads?.length ? (

@ -1,6 +1,5 @@
import styled, { css } from 'styled-components' import styled, { css } from 'styled-components'
import { isMobileDevice } from '../../config'
import { isMobileDevice } from 'config'
export const HeaderWrapAd = styled.div<{column: number}>` export const HeaderWrapAd = styled.div<{column: number}>`
width: 100%; width: 100%;

@ -1,4 +1,4 @@
import { AdsListType } from 'requests' import { AdsListType } from '../../requests'
export enum PageType { export enum PageType {
HOME = 1, HOME = 1,
@ -23,6 +23,9 @@ export enum VIEW_ADS {
SQUARE = 6, SQUARE = 6,
SECOND_COLUMN = 2, SECOND_COLUMN = 2,
SECOND_ROW= 3, SECOND_ROW= 3,
HEADER_1 = 7,
HEADER_2 = 8,
HEADER_LONG = 9,
MOBILE_IN_COLLAPSE_HEADER = 12, MOBILE_IN_COLLAPSE_HEADER = 12,
MOBILE_IN_COLLAPSE_FOOTER = 25 MOBILE_IN_COLLAPSE_FOOTER = 25
} }

@ -1,7 +1,5 @@
import { Fragment, useState } from 'react' import { Fragment, useState } from 'react'
import { useRecoilValue } from 'recoil'
import { isLffClient } from 'config/clients' import { isLffClient } from 'config/clients'
import { import {
isMobileDevice, isMobileDevice,
@ -20,10 +18,7 @@ import {
} from 'features/MatchCard/CardFrontside/MatchCardMobile/styled' } from 'features/MatchCard/CardFrontside/MatchCardMobile/styled'
import { AdType } from 'requests' import { AdType } from 'requests'
import { useRecoilValue } from 'recoil'
import { VIEW_ADS } from 'components/Ads/types'
import { MobileAd } from 'components/Ads/components/MobileAd'
import { adsStore } from 'pages/HighlightsPage/storeHighlightsAtoms'
import { import {
CardWrapperOuter, CardWrapperOuter,
CardWrapper, CardWrapper,
@ -35,6 +30,9 @@ import {
} from './styled' } from './styled'
import { TournamentProps } from '../..' import { TournamentProps } from '../..'
import { VIEW_ADS } from '../../../../components/Ads/types'
import { MobileAd } from '../../../../components/Ads/components/MobileAd'
import { adsStore } from '../../../../pages/HighlightsPage/storeHighlightsAtoms'
export const TournamentMobile = ({ export const TournamentMobile = ({
tournament, tournament,

Loading…
Cancel
Save