feat(in-454): pr fix

pull/160/head
Margarita 3 years ago
parent a69fbe6c4b
commit c0a594d7c8
  1. 4
      src/features/Landings/hooks.tsx
  2. 16
      src/features/Landings/index.tsx
  3. 8
      src/features/Landings/styled.tsx
  4. 4
      src/features/MatchPage/store/hooks/index.tsx
  5. 2
      src/features/TournamentPage/hooks.tsx

@ -6,14 +6,14 @@ import {
import size from 'lodash/size'
import includes from 'lodash/includes'
import { PAGES } from 'config'
import type { TournamentInfo } from 'requests/getTournamentInfo'
import type { Landing } from 'requests/getLanding'
import { getLanding } from 'requests/getLanding'
import { getLandingLogo } from 'requests/getLandingMedia'
import { getTournamentInfo } from 'requests/getTournamentInfo'
import { PAGES } from 'config/pages'
import { redirectToUrl } from 'helpers/redirectToUrl'
import { useLexicsStore } from 'features/LexicsStore'

@ -1,14 +1,10 @@
import {
BaseSyntheticEvent,
Fragment,
useCallback,
} from 'react'
import { Fragment } from 'react'
import format from 'date-fns/format'
import map from 'lodash/map'
import { isMobileDevice } from 'config/userAgent'
import { isMobileDevice } from 'config'
import { T9n } from 'features/T9n'
@ -66,12 +62,6 @@ const Landings = () => {
} = useLandings()
const fallbackSrc = '/images/tournament-fallback.png'
const onError = useCallback((e: BaseSyntheticEvent) => {
// eslint-disable-next-line no-param-reassign
e.target.onError = ''
// eslint-disable-next-line no-param-reassign
e.target.src = fallbackSrc
}, [fallbackSrc])
if ((!tournamentInfo && !isNonExistLanding)
|| (isNonExistLanding && !nonExistLogoSrc)) return null
@ -115,7 +105,7 @@ const Landings = () => {
<LogoBackground />
<MainLogoImg
src={logo || nonExistLogoSrc}
onError={onError}
fallbackSrc={fallbackSrc}
/>
</MainLogoWrapper>
)

@ -2,7 +2,11 @@ import styled, { css } from 'styled-components/macro'
import { isMobileDevice } from 'config/userAgent'
import { ButtonSolid, customScrollbar } from 'features/Common'
import {
ButtonSolid,
customScrollbar,
Image,
} from 'features/Common'
import { Logo } from 'features/Logo'
type ButtonProps = {
@ -115,7 +119,7 @@ export const MainLogoWrapper = styled.div`
: ''};
`
export const MainLogoImg = styled.img`
export const MainLogoImg = styled(Image)`
width: 48%;
height: 48%;
position: relative;

@ -9,14 +9,14 @@ import includes from 'lodash/includes'
import filter from 'lodash/filter'
import isEmpty from 'lodash/isEmpty'
import { PAGES } from 'config'
import { useAuthStore } from 'features/AuthStore'
import { Tabs } from 'features/MatchSidePlaylists/config'
import { initialCircleAnimation } from 'features/CircleAnimationBar'
import type { TCircleAnimation } from 'features/CircleAnimationBar'
import { StatsType } from 'features/MatchSidePlaylists/components/TabStats/config'
import { PAGES } from 'config/pages'
import type { MatchInfo } from 'requests/getMatchInfo'
import { getMatchInfo } from 'requests/getMatchInfo'
import { getViewMatchDuration } from 'requests/getViewMatchDuration'

@ -13,7 +13,7 @@ import {
import { openSubscribePopup, redirectToUrl } from 'helpers'
import { PAGES } from 'config/pages'
import { PAGES } from 'config'
import { useName } from 'features/Name'

Loading…
Cancel
Save