fix(ott-300): moved fav store to abouve (#92)

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Armen 5 years ago committed by GitHub
parent 2534688392
commit ccacbb2a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      src/features/App/AuthenticatedApp.tsx
  2. 10
      src/features/MatchPage/index.tsx
  3. 7
      src/features/PlayerPage/index.tsx
  4. 7
      src/features/TeamPage/index.tsx
  5. 7
      src/features/TournamentPage/index.tsx

@ -22,6 +22,7 @@ import {
HeaderFiltersStore, HeaderFiltersStore,
} from 'features/HeaderFilters' } from 'features/HeaderFilters'
import { UserFavorites } from 'features/UserFavorites' import { UserFavorites } from 'features/UserFavorites'
import { UserFavoritesStore } from 'features/UserFavorites/store'
export const AuthenticatedApp = () => { export const AuthenticatedApp = () => {
useLexicsConfig(indexLexics) useLexicsConfig(indexLexics)
@ -36,28 +37,30 @@ export const AuthenticatedApp = () => {
</Route> </Route>
<HeaderFiltersStore> <HeaderFiltersStore>
<MainWrapper> <UserFavoritesStore>
<UserFavorites /> <MainWrapper>
<Header /> <UserFavorites />
<Route exact path={PAGES.home}> <Header />
<HomePage /> <Route exact path={PAGES.home}>
</Route> <HomePage />
</Route>
<Route path={`/:sportName${PAGES.tournament}/:pageId`}> <Route path={`/:sportName${PAGES.tournament}/:pageId`}>
<TournamentPage /> <TournamentPage />
</Route> </Route>
<Route path={`/:sportName${PAGES.team}/:pageId`}> <Route path={`/:sportName${PAGES.team}/:pageId`}>
<TeamPage /> <TeamPage />
</Route> </Route>
<Route path={`/:sportName${PAGES.player}/:pageId`}> <Route path={`/:sportName${PAGES.player}/:pageId`}>
<PlayerPage /> <PlayerPage />
</Route> </Route>
<Route path={`/:sportName${PAGES.match}/:pageId`}> <Route path={`/:sportName${PAGES.match}/:pageId`}>
<MatchPage /> <MatchPage />
</Route> </Route>
</MainWrapper> </MainWrapper>
</UserFavoritesStore>
</HeaderFiltersStore> </HeaderFiltersStore>
<Redirect to={PAGES.home} /> <Redirect to={PAGES.home} />
</Switch> </Switch>

@ -1,7 +1,5 @@
import React from 'react' import React from 'react'
import { UserFavoritesStore } from 'features/UserFavorites/store'
import { MatchProfileCard } from './MatchProfileCard' import { MatchProfileCard } from './MatchProfileCard'
import { import {
@ -9,9 +7,7 @@ import {
} from './styled' } from './styled'
export const MatchPage = () => ( export const MatchPage = () => (
<UserFavoritesStore> <MainWrapper>
<MainWrapper> <MatchProfileCard />
<MatchProfileCard /> </MainWrapper>
</MainWrapper>
</UserFavoritesStore>
) )

@ -1,9 +1,8 @@
import React from 'react' import React, { Fragment } from 'react'
import { ProfileTypes } from 'config' import { ProfileTypes } from 'config'
import { UserFavorites } from 'features/UserFavorites' import { UserFavorites } from 'features/UserFavorites'
import { ProfileCard } from 'features/ProfileCard' import { ProfileCard } from 'features/ProfileCard'
import { UserFavoritesStore } from 'features/UserFavorites/store'
import { usePlayerPage } from './hooks' import { usePlayerPage } from './hooks'
@ -14,13 +13,13 @@ export const PlayerPage = () => {
} = usePlayerPage() } = usePlayerPage()
return ( return (
<UserFavoritesStore> <Fragment>
<UserFavorites /> <UserFavorites />
<ProfileCard <ProfileCard
profileType={ProfileTypes.PLAYERS} profileType={ProfileTypes.PLAYERS}
name={name} name={name}
infoItems={infoItems} infoItems={infoItems}
/> />
</UserFavoritesStore> </Fragment>
) )
} }

@ -1,10 +1,9 @@
import React from 'react' import React, { Fragment } from 'react'
import { ProfileTypes } from 'config' import { ProfileTypes } from 'config'
import { UserFavorites } from 'features/UserFavorites' import { UserFavorites } from 'features/UserFavorites'
import { ProfileCard } from 'features/ProfileCard' import { ProfileCard } from 'features/ProfileCard'
import { UserFavoritesStore } from 'features/UserFavorites/store'
import { Matches } from 'features/Matches' import { Matches } from 'features/Matches'
import { useTeamPage } from './hooks' import { useTeamPage } from './hooks'
@ -17,7 +16,7 @@ export const TeamPage = () => {
} = useTeamPage() } = useTeamPage()
return ( return (
<UserFavoritesStore> <Fragment>
<UserFavorites /> <UserFavorites />
<Content> <Content>
<ProfileCard <ProfileCard
@ -27,6 +26,6 @@ export const TeamPage = () => {
/> />
<Matches /> <Matches />
</Content> </Content>
</UserFavoritesStore> </Fragment>
) )
} }

@ -1,11 +1,10 @@
import React from 'react' import React, { Fragment } from 'react'
import { ProfileTypes } from 'config' import { ProfileTypes } from 'config'
import { UserFavorites } from 'features/UserFavorites' import { UserFavorites } from 'features/UserFavorites'
import { ProfileCard } from 'features/ProfileCard' import { ProfileCard } from 'features/ProfileCard'
import { Matches } from 'features/Matches' import { Matches } from 'features/Matches'
import { UserFavoritesStore } from 'features/UserFavorites/store'
import { useTournamentPage } from './hooks' import { useTournamentPage } from './hooks'
import { Content } from './styled' import { Content } from './styled'
@ -17,7 +16,7 @@ export const TournamentPage = () => {
} = useTournamentPage() } = useTournamentPage()
return ( return (
<UserFavoritesStore> <Fragment>
<UserFavorites /> <UserFavorites />
<Content> <Content>
<ProfileCard <ProfileCard
@ -27,6 +26,6 @@ export const TournamentPage = () => {
/> />
<Matches /> <Matches />
</Content> </Content>
</UserFavoritesStore> </Fragment>
) )
} }

Loading…
Cancel
Save