feat(ott-296): team matches (#89)
parent
4b5b278b92
commit
6460d0cc2e
@ -0,0 +1,29 @@ |
||||
import { useEffect } from 'react' |
||||
|
||||
import { useHeaderFiltersStore } from 'features/HeaderFilters' |
||||
import { useSportNameParam, usePageId } from 'hooks' |
||||
|
||||
export const useTeamPage = () => { |
||||
const { sportType } = useSportNameParam() |
||||
const teamId = usePageId() |
||||
|
||||
const { |
||||
setSelectedSportTypeId, |
||||
setTeamId, |
||||
} = useHeaderFiltersStore() |
||||
|
||||
useEffect(() => { |
||||
setSelectedSportTypeId(sportType) |
||||
setTeamId(teamId) |
||||
|
||||
return () => { |
||||
setSelectedSportTypeId(null) |
||||
setTeamId(null) |
||||
} |
||||
}, [ |
||||
setSelectedSportTypeId, |
||||
setTeamId, |
||||
sportType, |
||||
teamId, |
||||
]) |
||||
} |
||||
@ -1,12 +1,21 @@ |
||||
import React from 'react' |
||||
import styled from 'styled-components' |
||||
|
||||
const TempPageTitle = styled.span` |
||||
padding: 20px; |
||||
font-size: 20px; |
||||
color: white; |
||||
` |
||||
import { UserFavorites } from 'features/UserFavorites' |
||||
import { Matches } from 'features/Matches' |
||||
import { UserFavoritesStore } from 'features/UserFavorites/store' |
||||
|
||||
export const TeamPage = () => ( |
||||
<TempPageTitle>TEAM PAGE</TempPageTitle> |
||||
) |
||||
import { useTeamPage } from './hooks' |
||||
import { Content } from './styled' |
||||
|
||||
export const TeamPage = () => { |
||||
useTeamPage() |
||||
|
||||
return ( |
||||
<UserFavoritesStore> |
||||
<UserFavorites /> |
||||
<Content> |
||||
<Matches /> |
||||
</Content> |
||||
</UserFavoritesStore> |
||||
) |
||||
} |
||||
|
||||
@ -0,0 +1,5 @@ |
||||
import styled from 'styled-components/macro' |
||||
|
||||
export const Content = styled.main` |
||||
padding: 0 16px; |
||||
` |
||||
Loading…
Reference in new issue