From 55e15e2b08bffc7c7e086b1ccf199a9d905e2557 Mon Sep 17 00:00:00 2001 From: Rakov Date: Thu, 8 Feb 2024 16:41:24 +0300 Subject: [PATCH] feat(rustat): rustat client_id --- .drone.yml | 55 ++++++++++++++++++- src/config/clients/index.tsx | 3 + src/config/clients/rustat.tsx | 51 +++++++++++++++++ src/config/clients/types.tsx | 8 ++- src/config/payments.tsx | 1 + .../AuthServiceApp/config/clients/index.tsx | 2 + .../AuthServiceApp/config/clients/rustat.tsx | 42 ++++++++++++++ src/features/AuthStore/helpers.tsx | 3 + src/react-app-env.d.ts | 2 +- 9 files changed, 162 insertions(+), 5 deletions(-) create mode 100644 src/config/clients/rustat.tsx create mode 100644 src/features/AuthServiceApp/config/clients/rustat.tsx diff --git a/.drone.yml b/.drone.yml index e0fc8e13..19cb4eae 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1059,4 +1059,57 @@ steps: - aws s3 sync build_insport_live s3://insports-live --delete - aws cloudfront create-invalidation --distribution-id E1LBC88VYP6XVB --paths "/*" depends_on: - - make-insport-live \ No newline at end of file + - make-insport-live + +--- +kind: pipeline +type: docker +name: deploy demo.insports.tv + +concurrency: + limit: 1 + +platform: + os: linux + arch: amd64 + +trigger: + ref: + - refs/heads/demo.insports.tv + +steps: + - name: npm-install + image: node:16-alpine + environment: + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK + commands: + - apk add --no-cache make + - npm install --legacy-peer-deps + + - name: make-demo-rustat + image: node:16-alpine + environment: + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK + commands: + - apk add --no-cache make + - make rustat-prod + depends_on: + - npm-install + + - name: deploy-demo-rustat + image: amazon/aws-cli:latest + environment: + AWS_ACCESS_KEY_ID: + from_secret: AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: AWS_SECRET_ACCESS_KEY + AWS_DEFAULT_REGION: + from_secret: AWS_DEFAULT_REGION + AWS_MAX_ATTEMPTS: 10 + commands: + - aws s3 sync build_rustat s3://insports-tv-demo --delete + - aws cloudfront create-invalidation --distribution-id ERAVP3O9V0PWR --paths "/*" + depends_on: + - make-demo-rustat \ No newline at end of file diff --git a/src/config/clients/index.tsx b/src/config/clients/index.tsx index 8b79c639..a748de30 100644 --- a/src/config/clients/index.tsx +++ b/src/config/clients/index.tsx @@ -7,6 +7,7 @@ import { insports } from './insports' import { india } from './india' import { tunisia } from './tunisia' import { fqtv } from './fqtv' +import { rustat } from './rustat' export const currentClient = process.env.REACT_APP_CLIENT || 'insports' @@ -17,6 +18,7 @@ export const isFacrClient = currentClient === 'facr' export const isIndiaClient = currentClient === 'india' export const isTunisClient = currentClient === 'tunisia' export const isFqtvClient = currentClient === 'fqtv' +export const isRustatClient = currentClient === 'rustat' const clients = { facr, @@ -25,6 +27,7 @@ const clients = { insports, instat, lff, + rustat, tunisia, } diff --git a/src/config/clients/rustat.tsx b/src/config/clients/rustat.tsx new file mode 100644 index 00000000..a14d0262 --- /dev/null +++ b/src/config/clients/rustat.tsx @@ -0,0 +1,51 @@ +import { css } from 'styled-components/macro' + +import { + ClientConfig, + ClientIds, + ClientNames, +} from './types' + +export const rustat: ClientConfig = { + auth: { + clientId: ClientIds.Rustat, + }, + 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, + host: 'demo.insports.tv', + name: ClientNames.Rustat, + privacyLink: '/privacy-policy-and-statement?client_id=insports-ott-web', + showSearch: true, + showSmartBanner: true, + styles: { + background: 'background-image: url(/images/Checker.png);', + logo: 'insports-logo.svg', + logoHeight: 2.465, + logoLeft: 1.7, + logoTop: 1.5, + logoWidth: 6.37, + matchLogoHeight: 2.465, + matchLogoWidth: 6.37, + matchPageMobileHeaderLogo: css` + width: 90px; + height: 27px; + top: 0; + `, + mobileHeaderLogo: css` + width: 77px; + height: 24px; + `, + userAccountLogo: css` + width: 6.37rem; + height: 2.465rem; + `, + }, + termsLink: '/terms-and-conditions?client_id=insports-ott-web', + title: 'InSports TV - The Home of Sports Streaming', +} diff --git a/src/config/clients/types.tsx b/src/config/clients/types.tsx index aa6672a9..96b571bb 100644 --- a/src/config/clients/types.tsx +++ b/src/config/clients/types.tsx @@ -12,7 +12,8 @@ export enum ClientIds { Insports = 'insports-ott-web', Instat = 'ott-web', Lff = 'lff-ott-web', - Tunisia = 'tunisia-ott-web', + Rustat = 'rustat-ott-web', + Tunisia = 'tunisia-ott-web' } export enum ClientNames { @@ -22,8 +23,9 @@ export enum ClientNames { India = 'india', // Индия Insports = 'insports', // Глобал Instat = 'instat', // Глобал - Lff = 'lff', // Латвия - Tunisia = 'tunisia' // Тунис + Lff = 'lff', // Тунис + Rustat = 'rustat', // Латвия + Tunisia = 'tunisia' // Россия } export type ClientConfig = { diff --git a/src/config/payments.tsx b/src/config/payments.tsx index cb803b31..b95beb1a 100644 --- a/src/config/payments.tsx +++ b/src/config/payments.tsx @@ -26,4 +26,5 @@ export const payments: PaymentsType = { [ClientNames.Facr]: PaymentSystem.Stripe, [ClientNames.Lff]: PaymentSystem.Stripe, [ClientNames.Fqtv]: PaymentSystem.Stripe, + [ClientNames.Rustat]: PaymentSystem.Stripe, } diff --git a/src/features/AuthServiceApp/config/clients/index.tsx b/src/features/AuthServiceApp/config/clients/index.tsx index 6fa1a439..4abc32c0 100644 --- a/src/features/AuthServiceApp/config/clients/index.tsx +++ b/src/features/AuthServiceApp/config/clients/index.tsx @@ -7,6 +7,7 @@ import { lff } from './lff' import { india } from './india' import { tunisia } from './tunisia' import { fqtv } from './fqtv' +import { rustat } from './rustat' export const clients = { [ClientIds.Facr]: facr, @@ -16,6 +17,7 @@ export const clients = { [ClientIds.Insports]: insports, [ClientIds.India]: india, [ClientIds.Tunisia]: tunisia, + [ClientIds.Rustat]: rustat, } const params = new URLSearchParams(window.location.search) diff --git a/src/features/AuthServiceApp/config/clients/rustat.tsx b/src/features/AuthServiceApp/config/clients/rustat.tsx new file mode 100644 index 00000000..8f6c757c --- /dev/null +++ b/src/features/AuthServiceApp/config/clients/rustat.tsx @@ -0,0 +1,42 @@ +import { css } from 'styled-components' + +import { rustat as platformRustat } from 'config/clients/rustat' +import { isMobileDevice } from 'config/userAgent' + +import { Background } from 'features/Background' + +import type { ClientConfig } from './types' + +export const rustat: ClientConfig = { + ...platformRustat, + 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: 85px; + width: 275px; + margin-bottom: 1.82rem; + + ${isMobileDevice ? css` + margin-bottom: 15px; + width: 165px; + height: 50px; + @media screen and (orientation: landscape){ + width: 92px; + height: 22px; + } + ` : ''} + `, + }, +} diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index 3f3a29c2..b8ecdc93 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -29,6 +29,8 @@ export const getClientNameByRedirectUri = () => { return 'diwan.insports' case ClientNames.Fqtv: return 'fqtv.insports' + case ClientNames.Rustat: + return 'demo.insports' case ClientNames.Facr: return ClientNames.Facr case ClientNames.Instat: @@ -43,6 +45,7 @@ const clientsForRedirect = { fqtv: ClientNames.Fqtv, india: ClientNames.India, lff: ClientNames.Lff, + rustat: ClientNames.Rustat, tunisia: ClientNames.Tunisia, } diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 3a42828c..a964fc63 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' | 'insports' | 'india' | 'tunisia' | 'fqtv', + REACT_APP_CLIENT: 'instat' | 'facr' | 'lff' | 'insports' | 'india' | 'tunisia' | 'fqtv' | 'rustat', REACT_APP_ENV: 'production' | 'preproduction' | 'staging', REACT_APP_STAGE: 'staging' | 'test-a' | 'test-b' | 'test-c' | 'test-d' | 'test-e' | 'test-f' | 'test-g' | 'test-h' | 'test-i' | 'test-j' | 'test', REACT_APP_TYPE: 'auth-service' | 'ott',