From 7f30d9b8a59c8b500ac05ec419de12b00cf593e1 Mon Sep 17 00:00:00 2001 From: Dmitry Kosolapov home Date: Wed, 31 Aug 2022 16:59:14 +0700 Subject: [PATCH] add client insports --- src/config/clients/index.tsx | 5 ++- src/config/clients/instat.tsx | 40 +++++++++++++++++++ src/config/clients/types.tsx | 2 + .../AuthServiceApp/config/clients/index.tsx | 8 ++-- .../AuthServiceApp/config/clients/instat.tsx | 33 +++++++++++++++ src/features/AuthStore/helpers.tsx | 4 +- src/features/HeaderMobile/styled.tsx | 2 +- src/features/ProfileHeader/styled.tsx | 2 +- src/react-app-env.d.ts | 2 +- 9 files changed, 89 insertions(+), 9 deletions(-) diff --git a/src/config/clients/index.tsx b/src/config/clients/index.tsx index 497b1fdb..c8277f36 100644 --- a/src/config/clients/index.tsx +++ b/src/config/clients/index.tsx @@ -1,16 +1,17 @@ import type { ClientConfig } from './types' import { facr } from './facr' -import { instat } from './instat' +import { instat, insports } from './instat' import { lff } from './lff' -export const currentClient = process.env.REACT_APP_CLIENT || 'instat' +export const currentClient = process.env.REACT_APP_CLIENT || 'insports' export const isLffClient = currentClient === 'lff' const clients = { facr, instat, + insports, lff, } diff --git a/src/config/clients/instat.tsx b/src/config/clients/instat.tsx index 394a2df0..b5303f74 100644 --- a/src/config/clients/instat.tsx +++ b/src/config/clients/instat.tsx @@ -44,3 +44,43 @@ export const instat: ClientConfig = { termsLink: '/terms-and-conditions', title: 'InStat TV - The Home of Sports Streaming', } + +export const insports: ClientConfig = { + auth: { + clientId: ClientIds.Instat, + }, + 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, + name: ClientNames.Insports, + privacyLink: '/privacy-policy-and-statement', + showSearch: true, + styles: { + background: 'background-image: url(/images/Checker.png);', + logo: 'logo.svg', + logoHeight: 1.465, + logoLeft: 1.7, + logoTop: 1.5, + logoWidth: 6.37, + matchLogoHeight: 1.465, + matchLogoWidth: 6.37, + matchPageMobileHeaderLogo: css` + width: 65px; + height: 15px; + `, + mobileHeaderLogo: css` + width: 84px; + height: 20px; + @media screen and (orientation: landscape){ + width: 92px; + height: 22px; + } + `, + userAccountLogo: css` + width: 6.37rem; + height: 1.465rem; + `, + }, + termsLink: '/terms-and-conditions', + title: 'InStat TV - The Home of Sports Streaming', +} diff --git a/src/config/clients/types.tsx b/src/config/clients/types.tsx index 6b9d46f6..7505c16a 100644 --- a/src/config/clients/types.tsx +++ b/src/config/clients/types.tsx @@ -8,12 +8,14 @@ export enum ClientIds { Facr = 'facr-ott-web', Instat = 'ott-web', Lff = 'lff-ott-web', + Insports = 'ott-web', } export enum ClientNames { Facr = 'facr', Instat = 'instat', Lff = 'lff', + Insports = 'insports', } export type ClientConfig = { diff --git a/src/features/AuthServiceApp/config/clients/index.tsx b/src/features/AuthServiceApp/config/clients/index.tsx index 2625d0cf..0a2cdc3f 100644 --- a/src/features/AuthServiceApp/config/clients/index.tsx +++ b/src/features/AuthServiceApp/config/clients/index.tsx @@ -1,15 +1,17 @@ -import { ClientIds } from 'config/clients/types' +import { ClientIds, ClientNames } from 'config/clients/types' import { facr } from './facr' -import { instat } from './instat' +import { instat, insports } from './instat' import { lff } from './lff' const clients = { [ClientIds.Facr]: facr, [ClientIds.Instat]: instat, [ClientIds.Lff]: lff, + [ClientIds.Insports]: insports, } + const params = new URLSearchParams(window.location.search) const clientId = params.get('client_id') as ClientIds -export const client = clients[clientId] || instat +export const client = clients[clientId] || insports diff --git a/src/features/AuthServiceApp/config/clients/instat.tsx b/src/features/AuthServiceApp/config/clients/instat.tsx index 4cb8a732..51100f41 100644 --- a/src/features/AuthServiceApp/config/clients/instat.tsx +++ b/src/features/AuthServiceApp/config/clients/instat.tsx @@ -39,3 +39,36 @@ export const instat: ClientConfig = { `, }, } + +export const insports: ClientConfig = { + ...platformInstat, + background: Background, + styles: { + centerBlock: css` + margin-top: 9.15rem; + ${isMobileDevice ? css` + margin-top: 107px; + @media screen and (orientation: landscape) { + width: 290px; + margin: auto; + } + ` : ''}; + `, + logo: css` + background-image: url(/images/logo.svg); + height: 54px; + width: 234px; + margin-bottom: 1.82rem; + + ${isMobileDevice ? css` + margin-bottom: 78px; + width: 207px; + height: 48px; + @media screen and (orientation: landscape){ + width: 92px; + height: 22px; + } + ` : ''} + `, + }, +} diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index 3d01d2d2..8dc8d757 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -22,8 +22,10 @@ export const getClientNameByRedirectUri = () => { return 'lff.instat' case ClientNames.Facr: return ClientNames.Facr - default: + case ClientNames.Instat: return ClientNames.Instat + default: + return ClientNames.Insports } } diff --git a/src/features/HeaderMobile/styled.tsx b/src/features/HeaderMobile/styled.tsx index c5d38327..91ac290a 100644 --- a/src/features/HeaderMobile/styled.tsx +++ b/src/features/HeaderMobile/styled.tsx @@ -18,7 +18,7 @@ export const defaultHeaderStyles = ( return client.styles.homePageHeader } - if (headerImage && client.name === 'instat') { + if (headerImage && (client.name === 'instat' || client.name === 'insports')) { return css`background: url(${headerImage}.png); background-size: 100% 100%; @media (max-width: 450px){ diff --git a/src/features/ProfileHeader/styled.tsx b/src/features/ProfileHeader/styled.tsx index 2747c630..6a9c6fe6 100644 --- a/src/features/ProfileHeader/styled.tsx +++ b/src/features/ProfileHeader/styled.tsx @@ -17,7 +17,7 @@ export const defaultHeaderStyles = ( return client.styles.homePageHeader } - if (headerImage && client.name === 'instat') { + if (headerImage && (client.name === 'instat' || client.name === 'insports')) { return css`background: url(${headerImage}.png); background-size: 100% 100%; @media (max-width: 450px){ diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 9544e295..d0615b00 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -3,7 +3,7 @@ declare namespace NodeJS { export interface ProcessEnv { - REACT_APP_CLIENT: 'instat' | 'facr' | 'lff', + REACT_APP_CLIENT: 'instat' | 'facr' | 'lff' | 'insports', REACT_APP_ENV: 'production' | 'preproduction' | 'staging', REACT_APP_STAGE: 'staging' | 'a-staging' | 'b-staging' | 'c-staging' | 'd-staging' | 'e-staging' | 'f-staging' | 'g-staging' | 'h-staging' | 'i-staging', REACT_APP_TYPE: 'auth-service' | 'ott',