feat(2313): add image for tournaiment

keep-around/6a5241e88c71aa438cbafa0e03cfcafaf85d1e13
Berdyshev Oleksandr 4 years ago
parent 2c7175983e
commit 6a5241e88c
  1. BIN
      public/images/5704.png
  2. 18
      src/features/ProfileHeader/index.tsx
  3. 10
      src/features/ProfileHeader/styled.tsx

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

@ -2,7 +2,11 @@ import { Fragment } from 'react'
import type { ReactNode } from 'react' import type { ReactNode } from 'react'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { PAGES } from 'config' import {
PAGES,
SportTypes,
ProfileTypes,
} from 'config'
import { client } from 'config/clients' import { client } from 'config/clients'
@ -12,6 +16,7 @@ import { ScoreSwitch } from 'features/MatchSwitches'
import { isMatchPage } from 'helpers/isMatchPage' import { isMatchPage } from 'helpers/isMatchPage'
import { usePageParams } from 'hooks/usePageParams'
import { useProfileColor } from './hooks' import { useProfileColor } from './hooks'
import { import {
@ -36,11 +41,20 @@ export const ProfileHeader = ({
height, height,
profileId, profileId,
}: Props) => { }: Props) => {
const {
profileType,
sportType,
} = usePageParams()
const url = '/images/5704.png'
const color = useProfileColor(profileId) const color = useProfileColor(profileId)
const imageHeader = profileId === 5704
&& sportType === SportTypes.FOOTBALL
&& profileType === ProfileTypes.TOURNAMENTS ? url : headerImage
return ( return (
<Fragment> <Fragment>
<HeaderStyled <HeaderStyled
headerImage={headerImage} headerImage={imageHeader}
color={headerColor || color} color={headerColor || color}
height={height} height={height}
> >

@ -9,7 +9,13 @@ import { Logo } from 'features/Logo'
export const DEFAULT_HEADER_COLOR = 'rgba(53, 96, 225, 0.56)' export const DEFAULT_HEADER_COLOR = 'rgba(53, 96, 225, 0.56)'
export const defaultHeaderStyles = (color: string = DEFAULT_HEADER_COLOR) => { export const defaultHeaderStyles = (
color: string = DEFAULT_HEADER_COLOR, headerImage: string | undefined | null,
) => {
if (headerImage && client.name !== 'facr') {
return css`background: url(${headerImage});
background-size: 100% 100%;`
}
if (color.includes('linear-gradient')) { if (color.includes('linear-gradient')) {
return css` return css`
background: ${color}; background: ${color};
@ -42,7 +48,7 @@ export const HeaderStyled = styled.header<HeaderProps>`
height: 124px; height: 124px;
} }
${({ color }) => defaultHeaderStyles(color)} ${({ color, headerImage }) => defaultHeaderStyles(color, headerImage)}
${isMobileDevice ${isMobileDevice
? css` ? css`

Loading…
Cancel
Save