fix(#564): add fixes

andreidekterev 3 years ago
parent 5172fdf560
commit 3c9df6e918
  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)
export const useAd = ({ ad, close: hideElement }: AdComponentType) => {
export const useAd = ({ ad }: AdComponentType) => {
const [isOpenAd, setIsOpenAd] = useState(true)
const views = getLocalStorageItem(adsViews) as ViewsType
const {

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

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

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

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

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

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

@ -1,5 +1,7 @@
import { Fragment, useState } from 'react'
import { useRecoilValue } from 'recoil'
import { isLffClient } from 'config/clients'
import {
isMobileDevice,
@ -18,7 +20,10 @@ import {
} from 'features/MatchCard/CardFrontside/MatchCardMobile/styled'
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 {
CardWrapperOuter,
CardWrapper,
@ -30,9 +35,6 @@ import {
} from './styled'
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 = ({
tournament,

Loading…
Cancel
Save