fix(#495): india client fixes

pull/181/head
Rakov 3 years ago
parent bd71c5ef0c
commit c9868effeb
  1. 3
      public/images/dollar-sign-grey.svg
  2. 3
      public/images/dollar-sign.svg
  3. 5
      src/config/clients/facr.tsx
  4. 7
      src/config/clients/india.tsx
  5. 5
      src/config/clients/insports.tsx
  6. 5
      src/config/clients/instat.tsx
  7. 5
      src/config/clients/lff.tsx
  8. 5
      src/config/clients/tunisia.tsx
  9. 5
      src/config/clients/types.tsx
  10. 6
      src/features/CompanyInfo/config.tsx
  11. 24
      src/features/CompanyInfo/index.tsx
  12. 50
      src/features/GlobalStores/index.tsx
  13. 20
      src/features/MatchCard/CardFrontside/MatchCardMobile/index.tsx
  14. 15
      src/features/MatchCard/CardFrontside/MatchCardMobile/styled.tsx
  15. 31
      src/features/MatchCard/CardFrontside/index.tsx
  16. 7
      src/features/MatchCard/styled.tsx
  17. 4
      src/features/UserAccount/index.tsx
  18. 1
      src/libs/index.ts
  19. 4
      src/libs/objects/Dollar.tsx
  20. 10
      src/libs/objects/Rupee.tsx

@ -1,3 +0,0 @@
<svg width="6" height="13" viewBox="0 0 6 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.80998 0.90332V2.65527H2.90764V0.90332H3.80998ZM3.69865 10.4717V12.042H2.80217V10.4717H3.69865ZM4.58342 8.5791C4.58342 8.35254 4.53654 8.15527 4.44279 7.9873C4.35295 7.81543 4.20451 7.66113 3.99748 7.52441C3.79045 7.38379 3.51311 7.25293 3.16545 7.13184C2.66545 6.95605 2.22795 6.75879 1.85295 6.54004C1.48186 6.31738 1.19279 6.04395 0.985762 5.71973C0.782637 5.3916 0.681075 4.9834 0.681075 4.49512C0.681075 4.01465 0.79045 3.59863 1.0092 3.24707C1.23186 2.89551 1.54045 2.62402 1.93498 2.43262C2.32951 2.24121 2.79045 2.14551 3.31779 2.14551C3.72404 2.14551 4.08928 2.20605 4.4135 2.32715C4.74162 2.44824 5.02092 2.62598 5.25139 2.86035C5.48186 3.09473 5.65764 3.38379 5.77873 3.72754C5.90373 4.06738 5.96623 4.45801 5.96623 4.89941H4.55998C4.55998 4.64941 4.53068 4.42676 4.47209 4.23145C4.4174 4.03223 4.33537 3.86426 4.226 3.72754C4.11662 3.58691 3.98381 3.47949 3.82756 3.40527C3.67522 3.33105 3.50139 3.29395 3.30607 3.29395C3.02873 3.29395 2.80022 3.34668 2.62053 3.45215C2.44084 3.55371 2.30803 3.69434 2.22209 3.87402C2.14006 4.05371 2.09904 4.25879 2.09904 4.48926C2.09904 4.71191 2.14201 4.90723 2.22795 5.0752C2.31389 5.24316 2.46037 5.39551 2.6674 5.53223C2.87834 5.66504 3.1674 5.7998 3.53459 5.93652C4.0385 6.11621 4.47404 6.31738 4.84123 6.54004C5.21232 6.75879 5.49748 7.03027 5.6967 7.35449C5.89982 7.6748 6.00139 8.0791 6.00139 8.56738C6.00139 9.07129 5.8842 9.49902 5.64982 9.85059C5.41936 10.2021 5.09514 10.4697 4.67717 10.6533C4.26311 10.833 3.78068 10.9229 3.2299 10.9229C2.88225 10.9229 2.53654 10.8779 2.19279 10.7881C1.85295 10.6943 1.54436 10.542 1.26701 10.3311C0.989669 10.1201 0.768965 9.84082 0.604903 9.49316C0.44084 9.1416 0.358809 8.71191 0.358809 8.2041H1.77678C1.77678 8.50879 1.81779 8.7627 1.89982 8.96582C1.98186 9.16895 2.09318 9.3291 2.23381 9.44629C2.37443 9.56348 2.53068 9.64746 2.70256 9.69824C2.87834 9.74902 3.05412 9.77441 3.2299 9.77441C3.52287 9.77441 3.76897 9.72559 3.96818 9.62793C4.17131 9.52637 4.32365 9.38574 4.42522 9.20605C4.53068 9.02246 4.58342 8.81348 4.58342 8.5791Z" fill="white" fill-opacity="0.7"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

@ -1,3 +0,0 @@
<svg width="12" height="23" viewBox="0 0 12 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.81201 15.5813C8.81201 14.9172 8.60107 14.3704 8.1792 13.9407C7.75732 13.5032 7.0542 13.1125 6.06982 12.7688C5.08545 12.4172 4.31982 12.093 3.77295 11.7961C1.95264 10.8196 1.04248 9.37427 1.04248 7.46021C1.04248 6.16333 1.43701 5.09692 2.22607 4.26099C3.01514 3.42505 4.08545 2.92896 5.43701 2.77271V0.218018H7.31201V2.79614C8.67139 2.99146 9.72217 3.56958 10.4644 4.53052C11.2065 5.48364 11.5776 6.72583 11.5776 8.25708H8.7417C8.7417 7.27271 8.51904 6.49927 8.07373 5.93677C7.63623 5.36646 7.03857 5.0813 6.28076 5.0813C5.53076 5.0813 4.94482 5.28442 4.52295 5.69067C4.10107 6.09692 3.89014 6.67896 3.89014 7.43677C3.89014 8.11646 4.09717 8.66333 4.51123 9.07739C4.93311 9.48364 5.64404 9.87036 6.64404 10.2375C7.64404 10.6047 8.4292 10.9446 8.99951 11.2571C9.56982 11.5696 10.0503 11.929 10.4409 12.3352C10.8315 12.7336 11.1323 13.1946 11.3433 13.718C11.5542 14.2415 11.6597 14.8547 11.6597 15.5579C11.6597 16.8782 11.2534 17.9485 10.4409 18.7688C9.63623 19.5891 8.51123 20.0735 7.06592 20.2219V22.5071H5.20264V20.2336C3.65576 20.0618 2.46436 19.5071 1.62842 18.5696C0.800293 17.6321 0.38623 16.3899 0.38623 14.843H3.23389C3.23389 15.8274 3.47998 16.5891 3.97217 17.1282C4.47217 17.6672 5.17529 17.9368 6.08154 17.9368C6.97217 17.9368 7.64795 17.7219 8.10889 17.2922C8.57764 16.8625 8.81201 16.2922 8.81201 15.5813Z" fill="#333333"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

@ -21,6 +21,11 @@ export const facr: ClientConfig = {
clientId: ClientIds.Facr,
metaDataUrlParams: `?hash=${randomHash()}`,
},
currencyBadge: {
color: '#333333',
secondColor: 'rgba(255, 255, 255, 0.7)',
sign: 'Dollar',
},
defaultLanguage: 'cs',
description: 'Live sports streaming platform. All matches playing under the auspices of Czech Republic FA. Access to full matches, various player playlists, and highlights. Free access in the Czech Republic. Available across all devices',
disabledPreferences: false,

@ -8,9 +8,14 @@ import { insports } from './insports'
export const india: ClientConfig = {
...insports,
about_the_project: 'https://prsolution.pro',
auth: {
clientId: ClientIds.India,
},
currencyBadge: {
color: '#000000',
secondColor: 'rgba(255, 255, 255, 0.7)',
sign: 'Rupee',
},
disabledHighlights: true,
name: ClientNames.India,
}

@ -9,6 +9,11 @@ export const insports: ClientConfig = {
auth: {
clientId: ClientIds.Insports,
},
currencyBadge: {
color: '#333333',
secondColor: 'rgba(255, 255, 255, 0.7)',
sign: 'Dollar',
},
defaultLanguage: 'en',
description: 'Live sports streaming platform. Football, basketball, ice hockey and more. Access to various player playlists and game highlights. Multiple subscription options. Available across all devices.',
disabledPreferences: true,

@ -9,6 +9,11 @@ export const instat: ClientConfig = {
auth: {
clientId: ClientIds.Instat,
},
currencyBadge: {
color: '#333333',
secondColor: 'rgba(255, 255, 255, 0.7)',
sign: 'Dollar',
},
defaultLanguage: 'en',
description: 'Live sports streaming platform. Football, basketball, ice hockey and more. Access to various player playlists and game highlights. Multiple subscription options. Available across all devices.',
disabledPreferences: true,

@ -9,6 +9,11 @@ export const lff: ClientConfig = {
auth: {
clientId: ClientIds.Lff,
},
currencyBadge: {
color: '#333333',
secondColor: 'rgba(255, 255, 255, 0.7)',
sign: 'Dollar',
},
defaultLanguage: 'lv',
description: 'Latvijas Futbola federācija (LFF) pašmāju futbola spēļu tiešraižu, apskatu un ierakstu platforma.',
disabledHighlights: true,

@ -15,6 +15,11 @@ export const tunisia: ClientConfig = {
clientId: ClientIds.Tunisia,
metaDataUrlParams: `?hash=${randomHash()}`,
},
currencyBadge: {
color: '#333333',
secondColor: 'rgba(255, 255, 255, 0.7)',
sign: 'Dollar',
},
defaultLanguage: 'fr',
description: '',
disabledFilters: true,

@ -30,6 +30,11 @@ export type ClientConfig = {
clientId: ClientIds,
metaDataUrlParams?: string,
},
currencyBadge: {
color: string,
secondColor: string,
sign: 'Dollar' | 'Rupee',
},
defaultLanguage: string,
description: string,
disabledFilters?: boolean,

@ -7,4 +7,10 @@ export const lexics = [
18170,
19588,
19590,
20140,
20141,
20142,
20143,
20144,
20145,
]

@ -64,6 +64,30 @@ export const CompanyInfo = ({
</CompanyInfoText>
</Fragment>
)
case ClientNames.India:
return (
<Fragment>
<CompanyInfoText>
<T9n t='20140' />
</CompanyInfoText>
<CompanyInfoText>
<T9n t='20141' />
</CompanyInfoText>
<CompanyInfoText>
<T9n t='20142' />
</CompanyInfoText>
<br />
<CompanyInfoText>
<T9n t='20143' />
</CompanyInfoText>
<CompanyInfoText>
<T9n t='20144' />
</CompanyInfoText>
<CompanyInfoText style={{ color: 'rgba(255, 255, 255, 0.8)' }}>
<T9n t='20145' />
</CompanyInfoText>
</Fragment>
)
default:
return (
<Fragment>

@ -1,20 +1,52 @@
import { ReactNode } from 'react'
import {
ReactNode,
useEffect,
useState,
} from 'react'
import { getLanguageUrlParam } from 'helpers/languageUrlParam'
import { useLocation } from 'react-router'
import { getLanguageUrlParam, redirectToUrl } from 'helpers'
import { AuthStore } from 'features/AuthStore'
import { LexicsStore } from 'features/LexicsStore'
import { getGeoInfo } from 'requests'
import { isInSportsClient } from 'config'
const initialLanguage = getLanguageUrlParam()
type Props = {
children: ReactNode,
}
export const GlobalStores = ({ children }: Props) => (
<LexicsStore initialLanguage={initialLanguage}>
<AuthStore>
{children}
</AuthStore>
</LexicsStore>
)
export const GlobalStores = ({ children }: Props) => {
const { pathname, search } = useLocation()
const [isGeoReady, setIsGeoReady] = useState(false)
useEffect(() => {
(async () => {
if (isInSportsClient) {
const geo = await getGeoInfo()
if (geo.country_code === 'IN') {
redirectToUrl(`https://india.insports.tv${pathname}${search}`)
return
}
}
setIsGeoReady(true)
})()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
if (!isGeoReady) return null
return (
<LexicsStore initialLanguage={initialLanguage}>
<AuthStore>
{children}
</AuthStore>
</LexicsStore>
)
}

@ -3,8 +3,12 @@ import { useLocation, useRouteMatch } from 'react-router'
import getUnixTime from 'date-fns/getUnixTime'
import { ProfileTypes, PAGES } from 'config'
import { isLffClient } from 'config/clients'
import {
ProfileTypes,
PAGES,
client,
isLffClient,
} from 'config'
import type { Match } from 'features/Matches'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
@ -12,6 +16,7 @@ import { useName } from 'features/Name'
import { T9n } from 'features/T9n'
import { MatchAccess } from 'features/Matches/helpers/getMatchClickAction'
import { useUserFavoritesStore } from 'features/UserFavorites/store'
import { Icon } from 'features/Icon'
import { getCardColor } from 'helpers/getCardColor'
@ -42,7 +47,6 @@ import {
FavoriteSign,
NameSignWrapper,
HoverFrame,
ScDollar,
MobTime,
} from './styled'
import { useCardPreview } from '../hooks'
@ -169,7 +173,15 @@ export const CardFrontsideMobile = ({
{isHomePage || isMatchPage ? <Time>{prepareTime}</Time> : null}
{access === MatchAccess.CanBuyMatch && (
<BuyMatchBadge>
<ScDollar refIcon='Dollar' />
<Icon
styles={{
display: 'flex',
justifyContent: 'center',
}}
refIcon={client.currencyBadge.sign}
size={10}
color={client.currencyBadge.secondColor}
/>
</BuyMatchBadge>
)}
</SecondaryInfo>

@ -4,7 +4,6 @@ import { devices } from 'config/devices'
import { isMobileDevice } from 'config/userAgent'
import { Name } from 'features/Name'
import { Icon } from 'features/Icon'
import { ProfileLogo } from 'features/ProfileLogo'
export const CardWrapperOuter = styled.li.attrs({
@ -347,7 +346,6 @@ export const BuyMatchBadge = styled.span`
height: 1.18rem;
cursor: pointer;
/* background-image: url(/images/dollar-sign.svg); */
color: rgba(255, 255, 255, 0.7);
background-position: center;
background-repeat: no-repeat;
@ -355,22 +353,15 @@ export const BuyMatchBadge = styled.span`
background-color: rgba(255, 255, 255, 0.19);
border-radius: 50%;
box-shadow: 0px 0.08rem 0.283rem rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
${isMobileDevice
? css`
position: static;
display: flex;
align-items: center;
justify-content: center;
width: 15px;
height: 15px;
/* background-size: 40%; */
`
: ''};
`
export const ScDollar = styled(Icon)`
display: flex;
justify-content: center;
align-items: center;
`

@ -4,7 +4,7 @@ import { useLocation, useRouteMatch } from 'react-router'
import getUnixTime from 'date-fns/getUnixTime'
import { ProfileTypes, PAGES } from 'config'
import { isLffClient } from 'config/clients'
import { client, isLffClient } from 'config/clients'
import type { LiveScore } from 'requests'
@ -44,6 +44,7 @@ import {
import { useCardPreview } from './hooks'
import { getPrepareTimeFormat } from '../helpers'
import { getPrepareDateFormat } from '../helpers/getPrepareDateFormat'
import { Icon } from '../../Icon'
type Props = {
isNeedFormatTimeChanged: boolean,
@ -149,9 +150,33 @@ export const CardFrontside = ({
/>
</TeamLogos>
)}
{access === MatchAccess.CanBuyMatch && <BuyMatchBadge isMatchPage={isMatchPage} />}
{access === MatchAccess.CanBuyMatch && !isMatchPage && (
<BuyMatchBadge>
<Icon
styles={{
display: 'flex',
justifyContent: 'center',
}}
refIcon={client.currencyBadge.sign}
size='0.85rem'
color={client.currencyBadge.color}
/>
</BuyMatchBadge>
)}
<MatchTimeInfo isMatchPage={isMatchPage}>
{access === MatchAccess.CanBuyMatch && isMatchPage && <BuyMatchBadgeCustom />}
{access === MatchAccess.CanBuyMatch && isMatchPage && (
<BuyMatchBadgeCustom>
<Icon
styles={{
display: 'flex',
justifyContent: 'center',
}}
refIcon={client.currencyBadge.sign}
size={13}
color={client.currencyBadge.secondColor}
/>
</BuyMatchBadgeCustom>
)}
<MatchDate isHomePage={isHomePage} isMatchPage={isMatchPage}>
{isHomePage || isMatchPage ? null : prepareDate}
<Time>{prepareTime}</Time>

@ -314,7 +314,6 @@ export const BuyMatchBadge = styled.span<CardProps>`
width: 1.18rem;
height: 1.18rem;
cursor: pointer;
background-image: url(/images/dollar-sign.svg);
background-position: center;
background-repeat: no-repeat;
background-size: 0.472rem 0.71rem;
@ -322,20 +321,20 @@ export const BuyMatchBadge = styled.span<CardProps>`
border-radius: 50%;
border: 0.5px solid rgba(0, 0, 0, 0.2);
box-shadow: 0px 0.08rem 0.283rem rgba(0, 0, 0, 0.5);
display: ${({ isMatchPage }) => (isMatchPage ? 'none' : 'block')};
display: flex;
justify-content: center;
align-items: center;
${isMobileDevice
? css`
width: 19px;
height: 17px;
background-size: 40%;
`
: ''};
`
export const BuyMatchBadgeCustom = styled(BuyMatchBadge)`
background-color: rgba(255, 255, 255, 0.19);
background-image: url(/images/dollar-sign-grey.svg);
background-size: auto;
min-width: 18px;
min-height: 18px;

@ -15,10 +15,10 @@ import { T9n } from 'features/T9n'
import {
client,
isFacrClient,
isInSportsClient,
isInstatClient,
isLffClient,
isTunisClient,
} from 'config/clients'
import { Header } from './components/Header'
@ -79,7 +79,7 @@ const UserAccount = () => {
>
<T9n t='my_devices' />
</StyledLink>
{!isLffClient && !isInSportsClient && !isTunisClient && (
{isFacrClient && (
<StyledLink
target='_blank'
to={{ pathname: client.about_the_project ?? PAGES.about_the_project }}

@ -14,3 +14,4 @@ export { PiP } from './objects/PiP'
export { PoweredByInstat } from './objects/PoweredByInstat'
export { PoweredByInsports } from './objects/PoweredByInsports'
export { Info } from './objects/Info'
export { Rupee } from './objects/Rupee'

@ -1,13 +1,9 @@
export const Dollar = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
fill='true'
width='10'
height='10'
viewBox='0 0 12 23'
>
<path
fill='currentColor'
d='M8.812 15.581c0-.664-.21-1.21-.633-1.64-.422-.438-1.125-.829-2.11-1.172-.984-.352-1.75-.676-2.296-.973-1.82-.976-2.73-2.422-2.73-4.336 0-1.297.394-2.363 1.183-3.199.79-.836 1.86-1.332 3.211-1.488V.218h1.875v2.578c1.36.195 2.41.774 3.152 1.735.742.953 1.114 2.195 1.114 3.726H8.742c0-.984-.223-1.758-.668-2.32-.438-.57-1.035-.856-1.793-.856-.75 0-1.336.203-1.758.61-.422.406-.633.988-.633 1.746 0 .68.207 1.226.621 1.64.422.407 1.133.793 2.133 1.16 1 .368 1.785.708 2.356 1.02.57.313 1.05.672 1.44 1.078.392.399.692.86.903 1.383.211.524.317 1.137.317 1.84 0 1.32-.407 2.39-1.22 3.21-.804.821-1.929 1.305-3.374 1.454v2.285H5.203v-2.273c-1.547-.172-2.739-.727-3.575-1.664C.8 17.632.386 16.39.386 14.843h2.848c0 .984.246 1.746.738 2.285.5.54 1.203.809 2.11.809.89 0 1.566-.215 2.027-.645.469-.43.703-1 .703-1.71z'
/>
</svg>

@ -0,0 +1,10 @@
export const Rupee = () => (
<svg
viewBox='0 0 13 24'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M12.0796 8.06355L11.4833 10.2177H0.0917969L0.688103 8.06355H12.0796ZM6.5664 21.3902L0.4447 14.1731L0.4325 12.3597H3.3413C4.09591 12.3597 4.71647 12.2258 5.20328 11.958C5.69822 11.6822 6.06739 11.3131 6.3108 10.8505C6.5542 10.38 6.6759 9.8567 6.6759 9.28057C6.6759 8.65579 6.56234 8.10406 6.3352 7.62539C6.10806 7.14672 5.74703 6.77348 5.25208 6.50567C4.75714 6.23802 4.10389 6.10412 3.29265 6.10412H0.103997L0.761155 3.66992H3.29265C4.72867 3.66992 5.92145 3.88501 6.87066 4.31504C7.82003 4.74506 8.5299 5.36984 9.0006 6.18922C9.47927 7.00875 9.71861 7.99863 9.71861 9.15887C9.71861 10.173 9.54419 11.0697 9.1952 11.8485C8.84636 12.6194 8.28243 13.244 7.50357 13.7228C6.72471 14.1934 5.69024 14.4854 4.40017 14.599L9.99846 21.2319V21.3902H6.5664ZM12.0918 3.66992L11.4833 5.82411H2.17293L2.76924 3.66992H12.0918Z'
/>
</svg>
)
Loading…
Cancel
Save