parent
9cc373a8d2
commit
7eea131fb5
@ -1,56 +1,29 @@ |
|||||||
import React from 'react' |
import React from 'react' |
||||||
import { Route, Switch } from 'react-router-dom' |
import { Link } from 'react-router-dom' |
||||||
|
|
||||||
|
import { PAGES } from 'config' |
||||||
|
|
||||||
import { ToggleScore } from 'features/ToggleScore' |
import { ToggleScore } from 'features/ToggleScore' |
||||||
import { Logo } from 'features/Logo' |
import { Logo } from 'features/Logo' |
||||||
import { Menu } from 'features/Menu' |
import { Menu } from 'features/Menu' |
||||||
import { Search } from 'features/Search' |
import { Search } from 'features/Search' |
||||||
import { |
|
||||||
DateFilter, |
|
||||||
MatchStatusFilter, |
|
||||||
} from 'features/HeaderFilters' |
|
||||||
import { PAGES } from 'config' |
|
||||||
|
|
||||||
import { |
import { |
||||||
HeaderMobileWrapper, |
HeaderMobileWrapper, |
||||||
HeaderMobileTop, |
|
||||||
HeaderMobileOnlyTop, |
|
||||||
HeaderMobileMidle, |
|
||||||
HeaderMobileBottom, |
|
||||||
HeaderIconsWrapper, |
HeaderIconsWrapper, |
||||||
IconFavWrapper, |
IconFavWrapper, |
||||||
} from './styled' |
} from './styled' |
||||||
|
|
||||||
export const HeaderMobile = () => ( |
export const HeaderMobile = () => ( |
||||||
<Switch> |
|
||||||
<Route path={PAGES.home} exact> |
|
||||||
<HeaderMobileWrapper> |
<HeaderMobileWrapper> |
||||||
<HeaderMobileTop> |
|
||||||
<ToggleScore /> |
<ToggleScore /> |
||||||
|
<Link to={PAGES.home}> |
||||||
<Logo width={52} height={12} /> |
<Logo width={52} height={12} /> |
||||||
|
</Link> |
||||||
<HeaderIconsWrapper> |
<HeaderIconsWrapper> |
||||||
<IconFavWrapper /> |
<IconFavWrapper /> |
||||||
<Search /> |
<Search /> |
||||||
<Menu /> |
<Menu /> |
||||||
</HeaderIconsWrapper> |
</HeaderIconsWrapper> |
||||||
</HeaderMobileTop> |
|
||||||
<HeaderMobileMidle> |
|
||||||
<DateFilter /> |
|
||||||
</HeaderMobileMidle> |
|
||||||
<HeaderMobileBottom> |
|
||||||
<MatchStatusFilter /> |
|
||||||
</HeaderMobileBottom> |
|
||||||
</HeaderMobileWrapper> |
</HeaderMobileWrapper> |
||||||
</Route> |
|
||||||
|
|
||||||
<HeaderMobileOnlyTop> |
|
||||||
<ToggleScore /> |
|
||||||
<Logo width={52} height={12} /> |
|
||||||
<HeaderIconsWrapper> |
|
||||||
<IconFavWrapper /> |
|
||||||
<Search /> |
|
||||||
<Menu /> |
|
||||||
</HeaderIconsWrapper> |
|
||||||
</HeaderMobileOnlyTop> |
|
||||||
</Switch> |
|
||||||
) |
) |
||||||
|
|||||||
@ -1,15 +1,43 @@ |
|||||||
import React from 'react' |
import React, { Fragment } from 'react' |
||||||
|
import { useMediaQuery } from 'react-responsive' |
||||||
|
|
||||||
|
import { devices } from 'config' |
||||||
|
|
||||||
import { Matches } from 'features/Matches' |
import { Matches } from 'features/Matches' |
||||||
|
import { |
||||||
|
DateFilter, |
||||||
|
MatchStatusFilter, |
||||||
|
} from 'features/HeaderFilters' |
||||||
|
import { |
||||||
|
HeaderMobileMidle, |
||||||
|
HeaderMobileBottom, |
||||||
|
} from 'features/HeaderMobile/styled' |
||||||
|
|
||||||
import { useHomePage } from './hooks' |
import { useHomePage } from './hooks' |
||||||
import { Content } from './styled' |
import { Content } from './styled' |
||||||
|
|
||||||
export const HomePage = () => { |
export const HomePage = () => { |
||||||
|
const isMobile = useMediaQuery({ query: devices.tablet }) |
||||||
const { fetchMatches } = useHomePage() |
const { fetchMatches } = useHomePage() |
||||||
return ( |
return ( |
||||||
|
<Fragment> |
||||||
|
{ |
||||||
|
isMobile |
||||||
|
? ( |
||||||
|
<Fragment> |
||||||
|
<HeaderMobileMidle> |
||||||
|
<DateFilter /> |
||||||
|
</HeaderMobileMidle> |
||||||
|
<HeaderMobileBottom> |
||||||
|
<MatchStatusFilter /> |
||||||
|
</HeaderMobileBottom> |
||||||
|
</Fragment> |
||||||
|
) |
||||||
|
: null |
||||||
|
} |
||||||
<Content> |
<Content> |
||||||
<Matches fetch={fetchMatches} /> |
<Matches fetch={fetchMatches} /> |
||||||
</Content> |
</Content> |
||||||
|
</Fragment> |
||||||
) |
) |
||||||
} |
} |
||||||
|
|||||||
Loading…
Reference in new issue