fix(565): hidden matches filter in matches page (#222)

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Mirlan 5 years ago committed by GitHub
parent b4a1f7cc19
commit bc1ef49c40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      src/features/HeaderMobile/index.tsx
  2. 6
      src/features/ProfileHeader/index.tsx

@ -1,5 +1,5 @@
import React from 'react'
import { Link } from 'react-router-dom'
import { Link, useRouteMatch } from 'react-router-dom'
import { PAGES } from 'config'
@ -14,17 +14,20 @@ import {
IconFavWrapper,
} from './styled'
export const HeaderMobile = () => (
<HeaderMobileWrapper>
<ScoreSwitch />
<AvailableMatchesSwitch />
<Link to={PAGES.home}>
<Logo width={52} height={12} />
</Link>
<HeaderIconsWrapper>
<IconFavWrapper />
<Search />
<Menu />
</HeaderIconsWrapper>
</HeaderMobileWrapper>
)
export const HeaderMobile = () => {
const isMatchPage = useRouteMatch(`/:sportName${PAGES.match}`)
return (
<HeaderMobileWrapper>
<ScoreSwitch />
{!isMatchPage && <AvailableMatchesSwitch />}
<Link to={PAGES.home}>
<Logo width={52} height={12} />
</Link>
<HeaderIconsWrapper>
<IconFavWrapper />
<Search />
<Menu />
</HeaderIconsWrapper>
</HeaderMobileWrapper>
)
}

@ -1,6 +1,7 @@
import React from 'react'
import { useRouteMatch } from 'react-router-dom'
import { devices } from 'config'
import { devices, PAGES } from 'config'
import { Menu } from 'features/Menu'
import { LanguageSelect } from 'features/LanguageSelect'
@ -18,6 +19,7 @@ import {
export const ProfileHeader = () => {
const isMobile = useMediaQuery({ query: devices.tablet })
const isMatchPage = useRouteMatch(`/:sportName${PAGES.match}`)
return (
isMobile
@ -32,7 +34,7 @@ export const ProfileHeader = () => {
<HeaderGroup>
<ScoreSwitch />
<AvailableMatchesSwitch />
{!isMatchPage && <AvailableMatchesSwitch />}
<MenuWrapper>
<Menu />
</MenuWrapper>

Loading…
Cancel
Save