fix(#522): hide getHighlights btn

pull/158/head
Andrei Dekterev 3 years ago
parent 9205c61454
commit 6a8d3f9200
  1. 30
      src/features/ProfileCard/index.tsx
  2. 5
      src/features/UserAccount/index.tsx

@ -1,7 +1,3 @@
import { useMemo } from 'react'
import { Link } from 'react-router-dom'
import type { ObjectWithName } from 'features/Name' import type { ObjectWithName } from 'features/Name'
import { import {
@ -9,8 +5,6 @@ import {
ProfileTypes, ProfileTypes,
URL_AWS, URL_AWS,
} from 'config' } from 'config'
import { client } from 'config/clients'
import { ClientNames } from 'config/clients/types'
import { checkPage } from 'helpers/checkPage' import { checkPage } from 'helpers/checkPage'
@ -29,7 +23,6 @@ import {
InfoFlag, InfoFlag,
StyledLink, StyledLink,
SсBtnWrapper, SсBtnWrapper,
SсGetHighlightBtn,
DetailsWrapper, DetailsWrapper,
} from './styled' } from './styled'
import { useProfileCard } from './hooks' import { useProfileCard } from './hooks'
@ -50,13 +43,11 @@ export const ProfileCard = ({ profile }: ProfileType) => {
isFavorite, isFavorite,
profileId, profileId,
profileType, profileType,
setPlayerHighlight,
sportType, sportType,
toggleFavorites, toggleFavorites,
} = useProfileCard() } = useProfileCard()
const tournamentId = profile.additionalInfo?.tournamentId const tournamentId = profile.additionalInfo?.tournamentId
const isPlayerPage = checkPage(PAGES.player)
const setGoogleAnalylicsID = () => { const setGoogleAnalylicsID = () => {
switch (true) { switch (true) {
@ -71,14 +62,16 @@ export const ProfileCard = ({ profile }: ProfileType) => {
} }
} }
const isGetHighLightShown = useMemo(() => { // const isPlayerPage = checkPage(PAGES.player)
switch (client.name) { //
case ClientNames.Facr: // const isGetHighLightShown = useMemo(() => {
return false // switch (client.name) {
default: // case ClientNames.Facr:
return true // return false
} // default:
}, []) // return true
// }
// }, [])
return ( return (
<Wrapper> <Wrapper>
@ -115,6 +108,7 @@ export const ProfileCard = ({ profile }: ProfileType) => {
<StarIcon isFavorite={isFavorite} /> <StarIcon isFavorite={isFavorite} />
<T9n t='add_to_favorites' /> <T9n t='add_to_favorites' />
</FavoriteButton> </FavoriteButton>
{/* временно отключили
{!client.disabledHighlights && isPlayerPage && isGetHighLightShown && ( {!client.disabledHighlights && isPlayerPage && isGetHighLightShown && (
<Link to={PAGES.highlights}> <Link to={PAGES.highlights}>
<SсGetHighlightBtn <SсGetHighlightBtn
@ -130,7 +124,7 @@ export const ProfileCard = ({ profile }: ProfileType) => {
<T9n t='get_highlights' /> <T9n t='get_highlights' />
</SсGetHighlightBtn> </SсGetHighlightBtn>
</Link> </Link>
)} )} */}
</SсBtnWrapper> </SсBtnWrapper>
</DetailsWrapper> </DetailsWrapper>
</Wrapper> </Wrapper>

@ -1,6 +1,6 @@
import { Fragment } from 'react' import { Fragment } from 'react'
import { Route, Link } from 'react-router-dom' import { Route } from 'react-router-dom'
import { PAGES } from 'config' import { PAGES } from 'config'
import { isProduction } from 'config/env' import { isProduction } from 'config/env'
@ -34,7 +34,6 @@ import {
Navigations, Navigations,
StyledLink, StyledLink,
UserAccountWrapper, UserAccountWrapper,
ScButtonGetHighlight,
} from './styled' } from './styled'
import { CompanyInfo } from '../CompanyInfo' import { CompanyInfo } from '../CompanyInfo'
import { PoweredByInsports } from './components/PoweredByInsports/PoweredByInsports' import { PoweredByInsports } from './components/PoweredByInsports/PoweredByInsports'
@ -91,6 +90,7 @@ const UserAccount = () => {
</Fragment> </Fragment>
)} )}
<ScoreSwitch /> <ScoreSwitch />
{/* временно отключили
{!client.disabledHighlights && ( {!client.disabledHighlights && (
<Link to={`${PAGES.highlights}`}> <Link to={`${PAGES.highlights}`}>
<ScButtonGetHighlight> <ScButtonGetHighlight>
@ -98,6 +98,7 @@ const UserAccount = () => {
</ScButtonGetHighlight> </ScButtonGetHighlight>
</Link> </Link>
)} )}
*/}
</Navigations> </Navigations>
</Aside> </Aside>
<ContentWrapper> <ContentWrapper>

Loading…
Cancel
Save