feat(#ott-2640): pre-release rework

keep-around/fdb88b04b32b9392e76795099e2ec47c9856b38b
alexnofoget 3 years ago
parent c7ad03f3bb
commit 38190b1176
  1. 33791
      package-lock.json
  2. BIN
      public/clients/lff/favicon/android-chrome-192x192.png
  3. BIN
      public/clients/lff/favicon/android-chrome-512x512.png
  4. BIN
      public/clients/lff/favicon/apple-touch-icon.png
  5. BIN
      public/clients/lff/favicon/favicon-16x16.png
  6. BIN
      public/clients/lff/favicon/favicon-32x32.png
  7. BIN
      public/clients/lff/favicon/favicon.ico
  8. 2
      src/config/clients/index.tsx
  9. 2
      src/config/clients/lff.tsx
  10. 1
      src/features/CompanyInfo/config.tsx
  11. 8
      src/features/CompanyInfo/index.tsx
  12. 1
      src/features/HeaderFilters/components/DateFilter/styled.tsx
  13. 3
      src/features/HeaderMobile/index.tsx
  14. 4
      src/features/HomePage/components/HeaderFilters/index.tsx
  15. 6
      src/features/MatchCard/CardFrontside/MatchCardMobile/index.tsx
  16. 10
      src/features/MatchCard/CardFrontside/MatchCardMobile/styled.tsx
  17. 6
      src/features/MatchCard/CardFrontside/index.tsx
  18. 9
      src/features/MatchCard/styled.tsx
  19. 2
      src/features/PageLayout/styled.tsx
  20. 4
      src/features/ProfileCard/index.tsx
  21. 4
      src/features/ProfileHeader/hooks.tsx
  22. 8
      src/features/TournamentList/components/TournamentMobile/index.tsx
  23. 9
      src/features/TournamentSubtitle/index.tsx
  24. 8
      src/features/TournamentSubtitle/styled.tsx
  25. 11
      src/features/UserAccount/index.tsx
  26. 18
      src/helpers/getCardColor/index.tsx
  27. 4
      src/helpers/getColor/index.ts

33791
package-lock.json generated

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

@ -6,6 +6,8 @@ import { lff } from './lff'
export const currentClient = process.env.REACT_APP_CLIENT || 'instat' export const currentClient = process.env.REACT_APP_CLIENT || 'instat'
export const isLffClient = currentClient === 'lff'
const clients = { const clients = {
facr, facr,
instat, instat,

@ -42,6 +42,6 @@ export const lff: ClientConfig = {
`, `,
}, },
termsLink: '/terms-and-conditions?client_id=lff-ott-web', termsLink: '/terms-and-conditions?client_id=lff-ott-web',
title: 'InStat TV - The Home of Sports Streaming', title: 'Latvijas Futbola federācija',
userAccountLinksDisabled: true, userAccountLinksDisabled: true,
} }

@ -6,4 +6,5 @@ export const lexics = [
18084, 18084,
18170, 18170,
19588, 19588,
19590,
] ]

@ -39,6 +39,14 @@ export const CompanyInfo = ({
</CompanyInfoText> </CompanyInfoText>
</Fragment> </Fragment>
) )
case ClientNames.Lff:
return (
<Fragment>
<CompanyInfoText>
<T9n t='19590' />
</CompanyInfoText>
</Fragment>
)
default: default:
return ( return (
<Fragment> <Fragment>

@ -77,6 +77,7 @@ export const DateButton = styled(BaseButton)<DateButtonProps>`
width: 1.3rem; width: 1.3rem;
height: 1.26rem; height: 1.26rem;
color: ${({ theme: { colors } }) => colors.dateButton}; color: ${({ theme: { colors } }) => colors.dateButton};
margin-left: 10px;
${isMobileDevice ${isMobileDevice
? css` ? css`

@ -1,6 +1,7 @@
import { useRecoilValue } from 'recoil' import { useRecoilValue } from 'recoil'
import { isIOS } from 'config/userAgent' import { isIOS } from 'config/userAgent'
import { isLffClient } from 'config/clients'
import { HeaderMenu } from 'features/HeaderMenu' import { HeaderMenu } from 'features/HeaderMenu'
import { DateFilter } from 'features/HeaderFilters' import { DateFilter } from 'features/HeaderFilters'
@ -34,7 +35,7 @@ export const HeaderMobile = ({ isOpenDownload, setIsOpenDownload }: HeaderBanner
<HeaderMenu /> <HeaderMenu />
<DateFilter /> <DateFilter />
<ScSportsWrapper> <ScSportsWrapper>
{isSportFilterShown ? <SportsFilter /> : null} {!isLffClient && isSportFilterShown ? <SportsFilter /> : null}
<ScoreSwitchWrapper> <ScoreSwitchWrapper>
<ScoreSwitch /> <ScoreSwitch />
</ScoreSwitchWrapper> </ScoreSwitchWrapper>

@ -1,5 +1,7 @@
import { useRecoilValue } from 'recoil' import { useRecoilValue } from 'recoil'
import { isLffClient } from 'config/clients'
import { SportsFilter } from 'features/SportsFilter' import { SportsFilter } from 'features/SportsFilter'
import { SelectFilter } from 'components/SelectFilter' import { SelectFilter } from 'components/SelectFilter'
import { useHeaderFiltersStore } from 'features/HeaderFilters' import { useHeaderFiltersStore } from 'features/HeaderFilters'
@ -57,7 +59,7 @@ export const HeaderFilters = () => {
/> />
</> </>
)} )}
{isShowTournament && isSportFilterShown && <SportsFilter />} {!isLffClient && isShowTournament && isSportFilterShown && <SportsFilter />}
{isShowTournament && ( {isShowTournament && (
<ScFilterItemsWrap> <ScFilterItemsWrap>

@ -4,6 +4,7 @@ import { useLocation, useRouteMatch } from 'react-router'
import getUnixTime from 'date-fns/getUnixTime' import getUnixTime from 'date-fns/getUnixTime'
import { ProfileTypes, PAGES } from 'config' import { ProfileTypes, PAGES } from 'config'
import { isLffClient } from 'config/clients'
import type { Match } from 'features/Matches' import type { Match } from 'features/Matches'
import { useMatchSwitchesStore } from 'features/MatchSwitches' import { useMatchSwitchesStore } from 'features/MatchSwitches'
@ -11,6 +12,7 @@ import { useName } from 'features/Name'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
import { MatchAccess } from 'features/Matches/helpers/getMatchClickAction' import { MatchAccess } from 'features/Matches/helpers/getMatchClickAction'
import { useUserFavoritesStore } from 'features/UserFavorites/store' import { useUserFavoritesStore } from 'features/UserFavorites/store'
import { getCardColor } from 'helpers/getCardColor'
import { NoAccessMessage } from '../../NoAccessMessage' import { NoAccessMessage } from '../../NoAccessMessage'
import { getPrepareTimeFormat } from '../../helpers' import { getPrepareTimeFormat } from '../../helpers'
@ -91,8 +93,8 @@ export const CardFrontsideMobile = ({
<CardWrapperOuter onClick={onClick} onKeyPress={onKeyPress}> <CardWrapperOuter onClick={onClick} onKeyPress={onKeyPress}>
<CardWrapper> <CardWrapper>
<HoverFrame /> <HoverFrame />
<PreviewWrapper> <PreviewWrapper isGradientPreview={isLffClient} color={getCardColor(tournament.id)}>
{previewImage && ( {!isLffClient && previewImage && (
<Preview title={tournamentName} src={previewImage} /> <Preview title={tournamentName} src={previewImage} />
)} )}
{access === MatchAccess.NoCountryAccess ? ( {access === MatchAccess.NoCountryAccess ? (

@ -64,11 +64,19 @@ export const HoverFrame = styled.div`
} }
` `
export const PreviewWrapper = styled.div` type TPreviewWrapper = {
color?: string,
isGradientPreview?: boolean,
}
export const PreviewWrapper = styled.div<TPreviewWrapper>`
position: relative; position: relative;
display: flex; display: flex;
width: 100%; width: 100%;
height: 60%; height: 60%;
${({ color, isGradientPreview }) => isGradientPreview
&& css`
background: ${color};`}
${isMobileDevice ${isMobileDevice
? css` ? css`
width: 40%; width: 40%;

@ -4,7 +4,9 @@ import { useLocation, useRouteMatch } from 'react-router'
import getUnixTime from 'date-fns/getUnixTime' import getUnixTime from 'date-fns/getUnixTime'
import { ProfileTypes, PAGES } from 'config' import { ProfileTypes, PAGES } from 'config'
import { isLffClient } from 'config/clients'
import { getCardColor } from 'helpers/getCardColor'
import type { Match } from 'features/Matches' import type { Match } from 'features/Matches'
import { useMatchSwitchesStore } from 'features/MatchSwitches' import { useMatchSwitchesStore } from 'features/MatchSwitches'
import { useName } from 'features/Name' import { useName } from 'features/Name'
@ -98,8 +100,8 @@ export const CardFrontside = ({
> >
<CardWrapper isMatchPage={isMatchPage}> <CardWrapper isMatchPage={isMatchPage}>
<HoverFrame /> <HoverFrame />
<PreviewWrapper> <PreviewWrapper isGradientPreview={isLffClient} color={getCardColor(tournament.id)}>
{previewImage && ( {!isLffClient && previewImage && (
<Preview <Preview
title={tournamentName} title={tournamentName}
src={previewImage} src={previewImage}

@ -66,12 +66,19 @@ export const HoverFrame = styled.div`
border: 2px solid #fff border: 2px solid #fff
} }
` `
type TPreviewWrapper = {
color?: string,
isGradientPreview?: boolean,
}
export const PreviewWrapper = styled.div` export const PreviewWrapper = styled.div<TPreviewWrapper>`
position: relative; position: relative;
display: flex; display: flex;
width: 100%; width: 100%;
height: 60%; height: 60%;
${({ color, isGradientPreview }) => isGradientPreview
&& css`
background: ${color};`}
${isMobileDevice ${isMobileDevice
? css` ? css`
width: 50%; width: 50%;

@ -34,5 +34,5 @@ export const BodyBackdrop = styled.div`
background-color: rgba(0, 0, 0, 0.7); background-color: rgba(0, 0, 0, 0.7);
width: 100vw; width: 100vw;
height: calc(100vh - 8.5rem); height: calc(100vh - 8.5rem);
z-index: 1; z-index: 2;
` `

@ -5,7 +5,7 @@ import { Link } from 'react-router-dom'
import type { ObjectWithName } from 'features/Name' import type { ObjectWithName } from 'features/Name'
import { PAGES, ProfileTypes } from 'config' import { PAGES, ProfileTypes } from 'config'
import { client } from 'config/clients' import { client, isLffClient } from 'config/clients'
import { ClientNames } from 'config/clients/types' import { ClientNames } from 'config/clients/types'
import { checkPage } from 'helpers/checkPage' import { checkPage } from 'helpers/checkPage'
@ -91,7 +91,7 @@ export const ProfileCard = ({ profile }: ProfileType) => {
<StarIcon isFavorite={isFavorite} /> <StarIcon isFavorite={isFavorite} />
<T9n t='add_to_favorites' /> <T9n t='add_to_favorites' />
</FavoriteButton> </FavoriteButton>
{isPlayerPage && isGetHighLightShown && ( {!isLffClient && isPlayerPage && isGetHighLightShown && (
<Link to={PAGES.highlights}> <Link to={PAGES.highlights}>
<SсGetHighlightBtn <SсGetHighlightBtn
onClick={() => setPlayerHighlight({ onClick={() => setPlayerHighlight({

@ -40,6 +40,10 @@ export const useProfileColor = (profileId?: number) => {
) { ) {
return getColor(profileId) return getColor(profileId)
} }
const lffColorConfig = [928, 1620]
if (client.name === 'lff' && profileId && lffColorConfig.includes(profileId)) {
return getColor(profileId)
}
return color return color
} }

@ -1,4 +1,6 @@
import { useState } from 'react' import { Fragment, useState } from 'react'
import { isLffClient } from 'config/clients'
import { SportIcon } from 'components/SportIcon/SportIcon' import { SportIcon } from 'components/SportIcon/SportIcon'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
@ -44,10 +46,14 @@ export const TournamentMobile = ({
open={open} open={open}
> >
<ScFirstInfo> <ScFirstInfo>
{!isLffClient && (
<Fragment>
<SportIcon fill={open ? '#ffffff' : ''} sport={sportType} /> <SportIcon fill={open ? '#ffffff' : ''} sport={sportType} />
<CountryFlag <CountryFlag
src={`https://instatscout.com/images/flags/48/${countryId}.png`} src={`https://instatscout.com/images/flags/48/${countryId}.png`}
/> />
</Fragment>
)}
<TournamentName nameObj={tournament} /> <TournamentName nameObj={tournament} />
{isFavorite && ( {isFavorite && (
<FavoriteSign marginLeft={12} color={currentColor}> <FavoriteSign marginLeft={12} color={currentColor}>

@ -1,9 +1,12 @@
import { Fragment } from 'react'
import { SportIcon } from 'components/SportIcon/SportIcon' import { SportIcon } from 'components/SportIcon/SportIcon'
import { useName } from 'features/Name' import { useName } from 'features/Name'
import { useUserFavoritesStore } from 'features/UserFavorites/store' import { useUserFavoritesStore } from 'features/UserFavorites/store'
import { ProfileTypes, SportTypes } from 'config' import { ProfileTypes, SportTypes } from 'config'
import { isLffClient } from 'config/clients'
import { usePageParams } from 'hooks/usePageParams' import { usePageParams } from 'hooks/usePageParams'
@ -35,11 +38,15 @@ export const TournamentSubtitle = ({
return ( return (
<Wrapper> <Wrapper>
{!isLffClient && (
<Fragment>
<SportIcon sport={sportType ?? sportTypeFromUrl} /> <SportIcon sport={sportType ?? sportTypeFromUrl} />
<CountryFlag src={`https://instatscout.com/images/flags/48/${countryId}.png`} /> <CountryFlag src={`https://instatscout.com/images/flags/48/${countryId}.png`} />
</Fragment>
)}
{tournament && ( {tournament && (
<NameSignWrapper> <NameSignWrapper>
<TournamentName title={tournamentName}> <TournamentName isLeftSide={isLffClient} title={tournamentName}>
{tournamentName} {tournamentName}
</TournamentName> </TournamentName>
{tournamentInFavorites && <FavoriteSign marginLeft={12} />} {tournamentInFavorites && <FavoriteSign marginLeft={12} />}

@ -34,12 +34,16 @@ const nameStyles = css`
overflow: hidden; overflow: hidden;
` `
export const TournamentName = styled.span` type TTournamentName = {
isLeftSide?: boolean,
}
export const TournamentName = styled.span<TTournamentName>`
max-width: 95%; max-width: 95%;
color: rgba(255, 255, 255, 0.7); color: rgba(255, 255, 255, 0.7);
font-size: 0.567rem; font-size: 0.567rem;
line-height: 0.95rem; line-height: 0.95rem;
margin-left: 0.567rem; margin-left: ${({ isLeftSide }) => (isLeftSide ? '0px' : '0.567rem')};
${isMobileDevice ${isMobileDevice
? css` ? css`
font-size: 10px; font-size: 10px;

@ -1,4 +1,4 @@
import { useMemo } from 'react' import { Fragment, useMemo } from 'react'
import { Route, Link } from 'react-router-dom' import { Route, Link } from 'react-router-dom'
@ -14,7 +14,7 @@ import { usePageLogger } from 'hooks/usePageLogger'
import { useLexicsConfig } from 'features/LexicsStore' import { useLexicsConfig } from 'features/LexicsStore'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
import { client } from 'config/clients' import { client, isLffClient } from 'config/clients'
import { Header } from './components/Header' import { Header } from './components/Header'
import { PagePersonalInfo } from './components/PagePersonalInfo' import { PagePersonalInfo } from './components/PagePersonalInfo'
import { PageBankCards } from './components/PageBankCards' import { PageBankCards } from './components/PageBankCards'
@ -56,6 +56,8 @@ const UserAccount = () => {
<StyledLink to={`${PAGES.useraccount}/personal-info`}> <StyledLink to={`${PAGES.useraccount}/personal-info`}>
<T9n t='personal_info' /> <T9n t='personal_info' />
</StyledLink> </StyledLink>
{!isLffClient && (
<Fragment>
<StyledLink <StyledLink
disabled={user?.profile?.country_code === 'BR'} disabled={user?.profile?.country_code === 'BR'}
to={`${PAGES.useraccount}/bank-cards`} to={`${PAGES.useraccount}/bank-cards`}
@ -84,9 +86,10 @@ const UserAccount = () => {
<T9n t='about_the_project' /> <T9n t='about_the_project' />
</StyledLink> </StyledLink>
)} )}
</Fragment>
)}
<ScoreSwitch /> <ScoreSwitch />
{isAvailableToClient && ( {!isLffClient && isAvailableToClient && (
<Link to={`${PAGES.highlights}`}> <Link to={`${PAGES.highlights}`}>
<ScButtonGetHighlight> <ScButtonGetHighlight>
<T9n t='get_highlights' /> <T9n t='get_highlights' />

@ -0,0 +1,18 @@
import { isMobileDevice } from 'config/userAgent'
const degree = isMobileDevice ? '270deg' : '0deg'
export const getCardColor = (id: number | undefined): string => {
const defaultColor = 'none'
if (!id) return defaultColor
switch (id) {
case 928:
return `linear-gradient(${degree}, rgba(63,63,63,1) 35%, rgba(49,186,177,1) 100%);`
case 1620:
return `linear-gradient(${degree}, rgba(63,63,63,1) 35%, rgba(96,24,75,1) 100%);`
default:
return defaultColor
}
}

@ -14,6 +14,10 @@ export const getColor = (id: number | undefined): string => {
return 'linear-gradient(83.42deg, #000000 53.04%, #000000 94.83%), #000000' return 'linear-gradient(83.42deg, #000000 53.04%, #000000 94.83%), #000000'
case 3067: case 3067:
return 'linear-gradient(83.42deg, #007179 53.04%, #007179 94.83%), #000000' return 'linear-gradient(83.42deg, #007179 53.04%, #007179 94.83%), #000000'
case 928:
return 'linear-gradient(90deg, rgba(21,83,79,1) 0%, rgba(49,186,177,1) 100%);'
case 1620:
return 'linear-gradient(90deg, rgba(47,4,39,1) 0%, rgba(96,24,75,1) 100%);'
case 5665: case 5665:
case 23: case 23:
case 2719: case 2719:

Loading…
Cancel
Save