From 3668fc336d049d9e2a33b0449dfe45d20846b337 Mon Sep 17 00:00:00 2001 From: Rakov Roman Date: Wed, 31 Aug 2022 19:25:53 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20#2736?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit replaced logo for inSports client --- package-lock.json | 16 +++++++ package.json | 3 +- public/images/insports-logo.svg | 8 ++++ src/config/clients/index.tsx | 6 ++- src/config/clients/insports.tsx | 46 +++++++++++++++++++ src/config/clients/types.tsx | 2 +- .../AuthServiceApp/config/clients/index.tsx | 3 +- .../config/clients/insports.tsx | 42 +++++++++++++++++ .../AuthServiceApp/config/clients/instat.tsx | 35 +------------- src/features/CompanyInfo/index.tsx | 17 +++++++ src/features/UserAccount/index.tsx | 26 +++++------ 11 files changed, 151 insertions(+), 53 deletions(-) create mode 100644 public/images/insports-logo.svg create mode 100644 src/config/clients/insports.tsx create mode 100644 src/features/AuthServiceApp/config/clients/insports.tsx diff --git a/package-lock.json b/package-lock.json index 37b82195..e00d3b4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11650,6 +11650,7 @@ } }, "node_modules/caniuse-lite": { +<<<<<<< HEAD "version": "1.0.30001282", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001282.tgz", "integrity": "sha512-YhF/hG6nqBEllymSIjLtR2iWDDnChvhnVJqp+vloyt2tEHFG1yBR+ac2B/rOw0qOK0m0lEXU2dv4E/sMk5P9Kg==", @@ -11657,6 +11658,21 @@ "type": "opencollective", "url": "https://opencollective.com/browserslist" } +======= + "version": "1.0.30001378", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001378.tgz", + "integrity": "sha512-JVQnfoO7FK7WvU4ZkBRbPjaot4+YqxogSDosHv0Hv5mWpUESmN+UubMU6L/hGz8QlQ2aY5U0vR6MOs6j/CXpNA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] +>>>>>>> fdee7e23 (fix: 🐛 #2736) }, "node_modules/capture-exit": { "version": "2.0.0", diff --git a/package.json b/package.json index 1a69883f..b5af3eba 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "start:auth": "REACT_APP_TYPE=auth-service react-scripts start", "test:auth": "REACT_APP_TYPE=auth-service react-scripts test", "facr": "REACT_APP_CLIENT=facr react-scripts start", - "lff": "REACT_APP_CLIENT=lff react-scripts start" + "lff": "REACT_APP_CLIENT=lff react-scripts start", + "insports": "REACT_APP_CLIENT=insports react-scripts start" }, "dependencies": { "@jonkoops/matomo-tracker-react": "^0.7.0", diff --git a/public/images/insports-logo.svg b/public/images/insports-logo.svg new file mode 100644 index 00000000..33ea1def --- /dev/null +++ b/public/images/insports-logo.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/config/clients/index.tsx b/src/config/clients/index.tsx index c6fd81a4..72ddd498 100644 --- a/src/config/clients/index.tsx +++ b/src/config/clients/index.tsx @@ -1,12 +1,16 @@ import type { ClientConfig } from './types' import { facr } from './facr' -import { instat, insports } from './instat' +import { instat } from './instat' import { lff } from './lff' +import { insports } from './insports' export const currentClient = process.env.REACT_APP_CLIENT || 'insports' export const isLffClient = currentClient === 'lff' +export const isInSportsClient = currentClient === 'insports' +export const isInstatClient = currentClient === 'instat' +export const isFacrClient = currentClient === 'facr' const clients = { facr, diff --git a/src/config/clients/insports.tsx b/src/config/clients/insports.tsx new file mode 100644 index 00000000..94f4dfba --- /dev/null +++ b/src/config/clients/insports.tsx @@ -0,0 +1,46 @@ +import { css } from 'styled-components/macro' +import { + ClientConfig, + ClientIds, + ClientNames, +} from './types' + +export const insports: ClientConfig = { + auth: { + clientId: ClientIds.Insports, + }, + 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: 'insports-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: 'InSports TV - The Home of Sports Streaming', +} diff --git a/src/config/clients/types.tsx b/src/config/clients/types.tsx index 4ce50537..9cdaca4f 100644 --- a/src/config/clients/types.tsx +++ b/src/config/clients/types.tsx @@ -6,7 +6,7 @@ type StyledCss = ReturnType export enum ClientIds { Facr = 'facr-ott-web', - Insports = 'ott-web', + Insports = 'insports-ott-web', Instat = 'ott-web', Lff = 'lff-ott-web', } diff --git a/src/features/AuthServiceApp/config/clients/index.tsx b/src/features/AuthServiceApp/config/clients/index.tsx index f348494b..b1401617 100644 --- a/src/features/AuthServiceApp/config/clients/index.tsx +++ b/src/features/AuthServiceApp/config/clients/index.tsx @@ -1,7 +1,8 @@ import { ClientIds } from 'config/clients/types' import { facr } from './facr' -import { instat, insports } from './instat' +import { insports } from './insports' +import { instat } from './instat' import { lff } from './lff' const clients = { diff --git a/src/features/AuthServiceApp/config/clients/insports.tsx b/src/features/AuthServiceApp/config/clients/insports.tsx new file mode 100644 index 00000000..dec5255e --- /dev/null +++ b/src/features/AuthServiceApp/config/clients/insports.tsx @@ -0,0 +1,42 @@ +import { css } from 'styled-components' + +import { insports as platformInsports } from 'config/clients/insports' +import { isMobileDevice } from 'config/userAgent' + +import { Background } from 'features/Background' + +import type { ClientConfig } from './types' + +export const insports: ClientConfig = { + ...platformInsports, + 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/insports-logo.svg); + background-position: center; + height: 71px; + width: 234px; + margin-bottom: 1.82rem; + + ${isMobileDevice ? css` + margin-bottom: 15px; + width: 145px; + height: 45px; + @media screen and (orientation: landscape){ + width: 92px; + height: 22px; + } + ` : ''} + `, + }, +} diff --git a/src/features/AuthServiceApp/config/clients/instat.tsx b/src/features/AuthServiceApp/config/clients/instat.tsx index 51100f41..d3e3b6b2 100644 --- a/src/features/AuthServiceApp/config/clients/instat.tsx +++ b/src/features/AuthServiceApp/config/clients/instat.tsx @@ -1,11 +1,11 @@ import { css } from 'styled-components' import { instat as platformInstat } from 'config/clients/instat' +import { isMobileDevice } from 'config/userAgent' import { Background } from 'features/Background' import type { ClientConfig } from './types' -import { isMobileDevice } from '../../../../config/userAgent' export const instat: ClientConfig = { ...platformInstat, @@ -39,36 +39,3 @@ 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/CompanyInfo/index.tsx b/src/features/CompanyInfo/index.tsx index 246cccee..12c5b4a4 100644 --- a/src/features/CompanyInfo/index.tsx +++ b/src/features/CompanyInfo/index.tsx @@ -47,6 +47,23 @@ export const CompanyInfo = ({ ) + case ClientNames.Insports: + return ( + + + + + + + + + + + + + + + ) default: return ( diff --git a/src/features/UserAccount/index.tsx b/src/features/UserAccount/index.tsx index 355c8a28..b11dcddb 100644 --- a/src/features/UserAccount/index.tsx +++ b/src/features/UserAccount/index.tsx @@ -1,11 +1,10 @@ -import { Fragment, useMemo } from 'react' +import { Fragment } from 'react' import { Route, Link } from 'react-router-dom' import { PAGES } from 'config' import { isProduction } from 'config/env' import { userAccountLexics } from 'config/lexics/userAccount' -import { ClientNames } from 'config/clients/types' import { useAuthStore } from 'features/AuthStore' @@ -14,7 +13,13 @@ import { usePageLogger } from 'hooks/usePageLogger' import { useLexicsConfig } from 'features/LexicsStore' import { T9n } from 'features/T9n' -import { client, isLffClient } from 'config/clients' +import { + client, + isInSportsClient, + isInstatClient, + isLffClient, +} from 'config/clients' + import { Header } from './components/Header' import { PagePersonalInfo } from './components/PagePersonalInfo' import { PageBankCards } from './components/PageBankCards' @@ -38,15 +43,6 @@ const UserAccount = () => { usePageLogger(PAGES.useraccount) useLexicsConfig(userAccountLexics) - const isAvailableToClient = useMemo(() => { - switch (client.name) { - case ClientNames.Facr: - return false - default: - return true - } - }, []) - return (
@@ -78,7 +74,7 @@ const UserAccount = () => { > - {isAvailableToClient && ( + {!isLffClient && !isInSportsClient && ( { )} - {!isLffClient && isAvailableToClient && ( + {!isLffClient && ( @@ -114,7 +110,7 @@ const UserAccount = () => { - {client.name !== 'instat' && } + {!isInstatClient && !isInSportsClient && } ) }