Revert "fix(#564): fix styles ads ads types"

This reverts commit e188c32fcd.
pull/230/head
andreidekterev 3 years ago
parent 1e0a2cfc2d
commit 36fe1fff03
  1. 12
      src/components/Ads/components/AdComponent/styled.tsx
  2. 2
      src/components/Ads/components/MobileAd/index.tsx
  3. 2
      src/components/Ads/components/MobileAd/styled.tsx
  4. 2
      src/components/Ads/helpers/calcMaxDurationAds.tsx
  5. 5
      src/components/Ads/hooks.tsx
  6. 2
      src/components/Ads/styled.tsx
  7. 9
      src/config/userAgent.tsx
  8. 5
      src/features/MatchesGrid/index.tsx
  9. 34
      src/requests/getAds/getAds.tsx
  10. 8
      src/requests/getAds/updateAdsView.tsx

@ -1,4 +1,4 @@
import styled from 'styled-components/macro'
import styled from 'styled-components'
import { VIEW_ADS } from '../../types'
type Props = {
@ -7,15 +7,15 @@ type Props = {
const chooseStyle = (type: number) => {
switch (true) {
case VIEW_ADS.COLUMN === type:
case VIEW_ADS[type] === 'COLUMN':
return 'grid-row: 1 / 3; img {max-height: none;}'
case VIEW_ADS.ROW === type:
case VIEW_ADS[type] === 'ROW':
return 'grid-column: 1 / 3'
case VIEW_ADS.SQUARE === type:
case VIEW_ADS[type] === 'SQUARE':
return 'grid-row: 1 / 3; grid-column: 1 / 3; img {max-height: none;}'
case VIEW_ADS.SECOND_COLUMN === type:
case VIEW_ADS[type] === 'SECOND_COLUMN':
return 'grid-column: 2 / 3; grid-row: 1 / 1'
case VIEW_ADS.SECOND_ROW === type:
case VIEW_ADS[type] === 'SECOND_ROW':
return 'grid-column: 1 / 2; grid-row: 2 / 3;'
default:
return ''

@ -1,4 +1,4 @@
import type { MouseEvent } from 'react'
import { MouseEvent } from 'react'
import type { AdType } from 'requests'

@ -1,4 +1,4 @@
import styled from 'styled-components/macro'
import styled from 'styled-components'
type Props = {
position: number,

@ -1,4 +1,4 @@
import type { AdResponse, AdsListType } from 'requests'
import { AdResponse, AdsListType } from 'requests'
export const calcMaxAdDurationAds = (advertisements: AdResponse) => {
const allAds = Object.values(advertisements)

@ -1,7 +1,4 @@
import { useMemo } from 'react'
import { useQuery } from 'react-query'
import { useRecoilState } from 'recoil'
import { isMobileDevice, querieKeys } from 'config'
@ -10,6 +7,8 @@ import { getAds } from 'requests'
import { useLang } from 'features/LexicsStore/hooks/useLang'
import { useMemo } from 'react'
import { useAuthStore } from 'features/AuthStore'
import {

@ -1,4 +1,4 @@
import styled, { css } from 'styled-components/macro'
import styled, { css } from 'styled-components'
import { isMobileDevice } from 'config'

@ -1,8 +1,7 @@
export const device = navigator.userAgent
export const isIOS = /iPad|iPhone|iPod/.test(device)
export const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent)
export const isAndroid = /Android/.test(device)
export const isAndroid = /Android/.test(navigator.userAgent)
export const isMobileDevice = /iPhone|Android/.test(device)
export const isMobileDevice = /iPhone|Android/.test(navigator.userAgent)
export const device = navigator.userAgent

@ -1,11 +1,7 @@
import { memo, useEffect } from 'react'
import { useRouteMatch } from 'react-router-dom'
import { useQuery } from 'react-query'
import { useRecoilValue } from 'recoil'
import { isMobileDevice, PAGES } from 'config'
import type { AdType, LiveScore } from 'requests'
@ -18,6 +14,7 @@ import { useHeaderFiltersStore } from 'features/HeaderFilters'
import { readToken } from 'helpers'
import { useRecoilValue } from 'recoil'
import { Wrapper } from './styled'
import { useMatchSwitchesStore } from '../MatchSwitches'
import { querieKeys } from '../../config'

@ -10,27 +10,27 @@ export type AdsParams = {
}
export type AdType = {
duration: number,
frequency: number,
id: number,
impressions: number,
link: string,
media: {
'duration': number,
'frequency': number,
'id': number,
'impressions': number,
'link': string,
'media': {
url: string,
},
name: string,
position: {
id: number,
name_eng: string,
name_rus: string,
source_type: string,
'name': string,
'position': {
'id': number,
'name_eng': string,
'name_rus': string,
'source_type': string,
},
remaining_views: number,
time_close: number,
type: {
id: number,
name_eng: string,
name_rus: string,
'time_close': number,
'type': {
'id': number,
'name_eng': string,
'name_rus': string,
},
}

@ -7,10 +7,10 @@ export type AdsViewParams = {
}
type AdsViewResponse = {
data: string,
message: string,
reason: string,
status: 'failed' | 'failed' | 'success',
'data': string,
'message': string,
'reason': string,
'status': 'failed' | 'failed' | 'success',
}
export const updateAdsView = (

Loading…
Cancel
Save