diff --git a/.drone.yml b/.drone.yml index cec503c6..b40025ce 100644 --- a/.drone.yml +++ b/.drone.yml @@ -172,32 +172,35 @@ steps: depends_on: - make-lff -# - name: make-diwansport -# image: node:16-alpine -# environment: -# REACT_APP_STRIPE_PK: -# from_secret: REACT_APP_STRIPE_PK -# commands: -# - apk add --no-cache make -# - make diwansport-prod -# depends_on: -# - npm-install -# -# - name: deploy-diwansport -# 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_insports-diwansport s3://insports-diwansport --delete -# - aws cloudfront create-invalidation --distribution-id E3LKAH6TR4O2JL --paths "/*" -# depends_on: -# - make-diwansport + - name: make-diwansport + image: node:16-alpine + environment: + REACT_APP_STRIPE_PK: + from_secret: REACT_APP_STRIPE_PK + commands: + - apk add --no-cache make + - make diwansport-prod + depends_on: + - npm-install + + - name: deploy-diwansport + 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_insports-diwansport s3://insports-diwansport --delete + - aws cloudfront create-invalidation --distribution-id E3LKAH6TR4O2JL --paths "/*" + - aws cloudfront create-invalidation --distribution-id E3LKAH6TR4O2JL --paths "/*" # # diwansport.net + - aws cloudfront create-invalidation --distribution-id E3NJ2G0QSB6MVI --paths "/*" # tunisia.insports.tv + + depends_on: + - make-diwansport --- kind: pipeline diff --git a/Makefile b/Makefile index bd0669a8..04944847 100644 --- a/Makefile +++ b/Makefile @@ -130,6 +130,12 @@ india-build: clean REACT_APP_CLIENT=india \ npm run build +tunisia-build: clean + REACT_APP_TYPE=ott \ + REACT_APP_ENV=staging \ + REACT_APP_CLIENT=tunisia \ + npm run build + lff-build: clean REACT_APP_TYPE=ott \ REACT_APP_ENV=staging \ @@ -180,7 +186,16 @@ lff-prod: BUILD_PATH=build_lff \ npm run build && cp -r .well-known build_lff -deploy-all: prod preprod facr-prod lff-prod +diwansport-prod: + rm -rf build_tunisia && \ + REACT_APP_TYPE=ott \ + REACT_APP_ENV=production \ + REACT_APP_STRIPE_PK=pk_live_51J5TEYEDSxVnTgDW5XxhC6ntKZKddXgKHq5HOCDmJTdfSKluMYCdLHOcUA3Miuy8HesxG1eS4c0dQRQpMsEHRrQL00USpu5xIq \ + REACT_APP_CLIENT=tunisia \ + BUILD_PATH=build_tunisia \ + npm run build && cp -r .well-known build_tunisia + +deploy-all: prod preprod facr-prod lff-prod diwansport-prod india-prod test: npm test diff --git a/public/images/tunis_auth_logo_mobile.svg b/public/images/tunis_auth_logo_mobile.svg new file mode 100644 index 00000000..20e711c2 --- /dev/null +++ b/public/images/tunis_auth_logo_mobile.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/config/clients/index.tsx b/src/config/clients/index.tsx index f6835d60..ed298f2e 100644 --- a/src/config/clients/index.tsx +++ b/src/config/clients/index.tsx @@ -5,7 +5,7 @@ import { instat } from './instat' import { lff } from './lff' import { insports } from './insports' import { india } from './india' -import { tunis } from './tunis' +import { tunisia } from './tunisia' export const currentClient = process.env.REACT_APP_CLIENT || 'insports' @@ -22,7 +22,7 @@ const clients = { insports, instat, lff, - tunis, + tunis: tunisia, } export const client: ClientConfig = clients[currentClient] diff --git a/src/config/clients/lff.tsx b/src/config/clients/lff.tsx index 276f0a06..e0d1b1b2 100644 --- a/src/config/clients/lff.tsx +++ b/src/config/clients/lff.tsx @@ -11,6 +11,7 @@ export const lff: ClientConfig = { }, defaultLanguage: 'lv', 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.', + disabledHighlights: true, disabledPreferences: true, name: ClientNames.Lff, privacyLink: '/clients/instat/terms-and-conditions.html', diff --git a/src/config/clients/tunis.tsx b/src/config/clients/tunis.tsx deleted file mode 100644 index 6764be26..00000000 --- a/src/config/clients/tunis.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { css } from 'styled-components/macro' - -import { - ClientConfig, - ClientIds, - ClientNames, -} from './types' - -const randomHash = () => ( - (Math.random() ** Math.random()) * 9999999999999999 -) - -export const tunis: ClientConfig = { - auth: { - clientId: ClientIds.Tunis, - metaDataUrlParams: `?hash=${randomHash()}`, - }, - defaultLanguage: 'fr', - 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, - name: ClientNames.Tunis, - privacyLink: '/privacy-policy-and-statement', - showSearch: false, - styles: { - background: '', - homePageHeader: css` - background: radial-gradient( - 160.34% 257.27% at -7.45% 162.22%, - #2AB7AA 3.27%, - #02505C 43.69%, #0B2E4D 100%); - `, - logo: 'tunis-logo.svg', - logoHeight: 6.3, - logoLeft: 1.1, - logoTop: 1.74, - logoWidth: 8.25, - matchLogoHeight: 3.4, - matchLogoTopMargin: 0.9, - matchLogoWidth: 4.5, - matchPageMobileHeaderLogo: css` - width: 35px; - height: 25px; - top: 2px; - `, - mobileHeaderLogo: css` - width: 48px; - height: 37px; - `, - userAccountLogo: css` - width: 4.56rem; - height: 3.488rem; - `, - }, - termsLink: '/terms-and-conditions?client_id=facr-ott-web', - title: 'FACR.TV - The home of Czech football streaming', - userAccountLinksDisabled: true, -} diff --git a/src/config/clients/tunisia.tsx b/src/config/clients/tunisia.tsx new file mode 100644 index 00000000..bf16ab99 --- /dev/null +++ b/src/config/clients/tunisia.tsx @@ -0,0 +1,58 @@ +import { css } from 'styled-components/macro' + +import { + ClientConfig, + ClientIds, + ClientNames, +} from './types' + +const randomHash = () => ( + (Math.random() ** Math.random()) * 9999999999999999 +) + +export const tunisia: ClientConfig = { + auth: { + clientId: ClientIds.Tunisia, + metaDataUrlParams: `?hash=${randomHash()}`, + }, + defaultLanguage: 'fr', + description: '', + disabledFilters: true, + disabledHighlights: true, + disabledPreferences: true, + name: ClientNames.Tunisia, + privacyLink: '/privacy-policy-and-statement', + showSearch: true, + styles: { + background: '', + homePageHeader: css` + background: radial-gradient( + 160.34% 257.27% at -7.45% 162.22%, + #2AB7AA 3.27%, + #02505C 43.69%, #0B2E4D 100%); + `, + logo: 'tunisia-logo.svg', + logoHeight: 1.922, + logoLeft: 1.1, + logoTop: 1.74, + logoWidth: 9, + matchLogoHeight: 1.922, + matchLogoTopMargin: 0.9, + matchLogoWidth: 9, + matchPageMobileHeaderLogo: css` + width: 100px; + height: 21px; + top: 5px; + `, + mobileHeaderLogo: css` + width: 100px; + height: 21px; + `, + userAccountLogo: css` + width: 9rem; + height: 1.922rem; + `, + }, + termsLink: '/', + title: '', +} diff --git a/src/config/clients/types.tsx b/src/config/clients/types.tsx index 77f01e9b..88a59a2d 100644 --- a/src/config/clients/types.tsx +++ b/src/config/clients/types.tsx @@ -10,16 +10,17 @@ export enum ClientIds { Insports = 'insports-ott-web', Instat = 'ott-web', Lff = 'lff-ott-web', - Tunis = 'tunis-ott-web', + Tunisia = 'tunis-ott-web', } export enum ClientNames { + Brasil = 'brasil', Facr = 'facr', India = 'india', Insports = 'insports', Instat = 'instat', Lff = 'lff', - Tunis = 'tunis', + Tunisia = 'tunisia' } export type ClientConfig = { @@ -30,6 +31,8 @@ export type ClientConfig = { }, defaultLanguage: string, description: string, + disabledFilters?: boolean, + disabledHighlights?: boolean, disabledPreferences?: boolean, name: ClientNames, privacyLink: string, diff --git a/src/config/payments.tsx b/src/config/payments.tsx new file mode 100644 index 00000000..716d82a0 --- /dev/null +++ b/src/config/payments.tsx @@ -0,0 +1,15 @@ +import { ClientNames } from './clients/types' + +type PaymentsType = { + [key in ClientNames]: string +} + +export const payments: PaymentsType = { + [ClientNames.Tunisia]: 'paymee', + brasil: 'pag_brasil', + [ClientNames.India]: 'paytm', + [ClientNames.Insports]: 'stripe', + [ClientNames.Instat]: 'stripe', + [ClientNames.Facr]: 'stripe', + [ClientNames.Lff]: 'stripe', +} diff --git a/src/features/AuthServiceApp/config/clients/index.tsx b/src/features/AuthServiceApp/config/clients/index.tsx index 6de84332..f29566c8 100644 --- a/src/features/AuthServiceApp/config/clients/index.tsx +++ b/src/features/AuthServiceApp/config/clients/index.tsx @@ -5,7 +5,7 @@ import { insports } from './insports' import { instat } from './instat' import { lff } from './lff' import { india } from './india' -import { tunis } from './tunis' +import { tunisia } from './tunisia' const clients = { [ClientIds.Facr]: facr, @@ -13,7 +13,7 @@ const clients = { [ClientIds.Lff]: lff, [ClientIds.Insports]: insports, [ClientIds.India]: india, - [ClientIds.Tunis]: tunis, + [ClientIds.Tunisia]: tunisia, } const params = new URLSearchParams(window.location.search) diff --git a/src/features/AuthServiceApp/config/clients/tunis.tsx b/src/features/AuthServiceApp/config/clients/tunisia.tsx similarity index 82% rename from src/features/AuthServiceApp/config/clients/tunis.tsx rename to src/features/AuthServiceApp/config/clients/tunisia.tsx index b587b6e8..08120f46 100644 --- a/src/features/AuthServiceApp/config/clients/tunis.tsx +++ b/src/features/AuthServiceApp/config/clients/tunisia.tsx @@ -1,6 +1,6 @@ import styled, { css } from 'styled-components/macro' -import { tunis as platformTunis } from 'config/clients/tunis' +import { tunisia as platformTunis } from 'features/AuthServiceApp/config/clients/tunisia' import { isMobileDevice } from 'config/userAgent' import type { ClientConfig } from './types' @@ -16,7 +16,7 @@ const Background = styled.div` radial-gradient(152.89% 271.81% at 0% 96.71%, #2AB7AA 3.27%, #02505C 43.69%, #0B2E4D 100%); ` -export const tunis: ClientConfig = { +export const tunisia: ClientConfig = { ...platformTunis, background: Background, styles: { @@ -44,14 +44,15 @@ export const tunis: ClientConfig = { `, logo: css` background-image: url(/images/tunis_auth_logo.svg); - width: 200px; - height: 178px; + width: 102px; + height: 75px; margin-bottom: 1.82rem; ${isMobileDevice ? css` - margin-bottom: 20px; - width: 130px; - height: 100px; + background-image: url(/images/tunis_auth_logo_mobile.svg); + margin-bottom: 20px; + width: 102px; + height: 75px; ` : ''} `, popupApplyButton: css` diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index d9d1f050..f56ab034 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -22,11 +22,11 @@ export interface Settings extends UserManagerSettings { export const getClientNameByRedirectUri = () => { switch (client.name) { case ClientNames.Lff: - return 'lff.instat' + return 'lff.insports' case ClientNames.India: return 'india.insports' - case ClientNames.Tunis: - return ClientNames.Tunis + case ClientNames.Tunisia: + return 'tunisia.insports' case ClientNames.Facr: return ClientNames.Facr case ClientNames.Instat: @@ -44,7 +44,7 @@ const redirectUrl = () => { || client.name === 'lff' || client.name === 'facr' || client.name === 'india' - || client.name === 'tunis' + || client.name === 'tunisia' ): return `${window.origin}/redirect` case (ENV === 'staging' || ENV === 'preproduction'): diff --git a/src/features/BuyMatchPopup/components/BrazilPayment/hooks.tsx b/src/features/BuyMatchPopup/components/IframePayment/hooks.tsx similarity index 51% rename from src/features/BuyMatchPopup/components/BrazilPayment/hooks.tsx rename to src/features/BuyMatchPopup/components/IframePayment/hooks.tsx index e41d1e70..31d89480 100644 --- a/src/features/BuyMatchPopup/components/BrazilPayment/hooks.tsx +++ b/src/features/BuyMatchPopup/components/IframePayment/hooks.tsx @@ -1,12 +1,14 @@ import { + MouseEvent, useEffect, useState, - MouseEvent, } from 'react' import { useHistory } from 'react-router-dom' import { ProfileTypes } from 'config' +import { ClientNames } from 'config/clients/types' +import { payments } from 'config/payments' import isNumber from 'lodash/isNumber' @@ -15,7 +17,7 @@ import { useBuyMatchPopupStore } from 'features/BuyMatchPopup/store' import { getProfileUrl } from 'features/ProfileLink/helpers' import { getMatchInfo } from 'requests/getMatchInfo' -import { getBrazilPaymentUrl } from 'requests/getBrazilPaymentUrl' +import { getPaymentUrl } from 'requests/getPaymentUrl' import type { Props } from './index' @@ -25,11 +27,12 @@ type ResponsePayment = { type ResponsePaymentArray = ResponsePayment | null -export const useBrazilPayment = ({ +export const useIframePayment = ({ match, open, + paymentSystem, selectedPackage, - setIsOpenBrasilian, + setIsOpenIframe, }: Props) => { const history = useHistory() const { close } = useBuyMatchPopupStore() @@ -58,7 +61,7 @@ export const useBrazilPayment = ({ const closePopup = async (e?: MouseEvent) => { e?.stopPropagation() - setIsOpenBrasilian(false) + setIsOpenIframe(false) setError('') const accessMatch = await getMatchInfo(sportType, id) @@ -68,22 +71,60 @@ export const useBrazilPayment = ({ } } + // const paymentPaymee = async () => { + // const response: ResponseTypeTunis = await getTunisPaymentToken({ + // amount: originalObject.price, + // note: `${pack} ${teams}`, + // vendor: 5020, + // }) + // setSrc(`https://sandbox.paymee.tn/gateway/${response?.data.token}` || '') + // + // window.addEventListener( + // 'message', + // (event) => { + // if (event.data.event_id === 'paymee.complete') { + // // Execute Step 3 + // setSrc(`https://sandbox.paymee.tn/api/v1/payments/${response?.data.token}/check`) + // } + // }, false, + // ) + // } + + const paymentRequest = async () => { + const json: ResponsePaymentArray = await getPaymentUrl({ + action: pass === 'pass_match_access' ? 'one_payment' : 'create_subscription', + item: originalObject, + product_name: `${pack} ${teams}`, + service: paymentSystem, + }) + setSrc(json?.url || '') + } + + if (paymentSystem === payments[ClientNames.Brasil]) { // eslint-disable-next-line - window.onmessage = function (event) { - if (event.data === 'close') { - closePopup() + window.onmessage = function (event) { + if (event.data === 'close') { + closePopup() + } + } + + if (paymentSystem === payments[ClientNames.Tunisia]) { + window.addEventListener( + 'message', + (event) => { + if (event.data.event_id === 'paymee.complete') { + closePopup() + } + }, false, + ) } } + useEffect(() => { if (open) { (async () => { try { - const json: ResponsePaymentArray = await getBrazilPaymentUrl({ - action: pass === 'pass_match_access' ? 'one_payment' : 'create_subscription', - item: originalObject, - product_name: `${pack} ${teams}`, - }) - setSrc(json?.url || '') + await paymentRequest() } catch (err) { setError('error_payment_unsuccessful') } diff --git a/src/features/BuyMatchPopup/components/BrazilPayment/index.tsx b/src/features/BuyMatchPopup/components/IframePayment/index.tsx similarity index 79% rename from src/features/BuyMatchPopup/components/BrazilPayment/index.tsx rename to src/features/BuyMatchPopup/components/IframePayment/index.tsx index 7cd1abc0..63365967 100644 --- a/src/features/BuyMatchPopup/components/BrazilPayment/index.tsx +++ b/src/features/BuyMatchPopup/components/IframePayment/index.tsx @@ -2,7 +2,7 @@ import { Loader } from 'features/Loader' import { MatchPackage, Match } from 'features/BuyMatchPopup/types' import { T9n } from 'features/T9n' -import { useBrazilPayment } from './hooks' +import { useIframePayment } from './hooks' import { LoaderWrapper, @@ -12,25 +12,28 @@ import { export type Props = { match: Match, open: boolean, + paymentSystem: string, selectedPackage: MatchPackage, - setIsOpenBrasilian: (open: boolean) => void, + setIsOpenIframe: (open: boolean) => void, } -export const BrazilPayment = ({ +export const IframePayment = ({ match, open, + paymentSystem, selectedPackage, - setIsOpenBrasilian, + setIsOpenIframe, }: Props) => { const { closePopup, error, src, - } = useBrazilPayment({ + } = useIframePayment({ match, open, + paymentSystem, selectedPackage, - setIsOpenBrasilian, + setIsOpenIframe, }) return ( diff --git a/src/features/BuyMatchPopup/components/BrazilPayment/styled.tsx b/src/features/BuyMatchPopup/components/IframePayment/styled.tsx similarity index 100% rename from src/features/BuyMatchPopup/components/BrazilPayment/styled.tsx rename to src/features/BuyMatchPopup/components/IframePayment/styled.tsx diff --git a/src/features/BuyMatchPopup/components/PackageSelectionStep/index.tsx b/src/features/BuyMatchPopup/components/PackageSelectionStep/index.tsx index e1994140..58bacd38 100644 --- a/src/features/BuyMatchPopup/components/PackageSelectionStep/index.tsx +++ b/src/features/BuyMatchPopup/components/PackageSelectionStep/index.tsx @@ -8,6 +8,8 @@ import { import isNull from 'lodash/isNull' import { MDASH } from 'config' +import { payments } from 'config/payments' +import { client } from 'config/clients' import { CountryCodeType, getCountryCode } from 'requests/getCountryCode' @@ -18,7 +20,7 @@ import { useCardsStore } from 'features/CardsStore' import { ArrowLoader } from 'features/ArrowLoader' import { Arrow } from 'features/HeaderFilters/components/DateFilter/styled' -import { BrazilPayment } from '../BrazilPayment' +import { IframePayment } from '../IframePayment' import { useBuyMatchPopupStore } from '../../store' import { SelectedCard } from '../SelectedCard' @@ -38,7 +40,7 @@ export const PackageSelectionStep = () => { cards, fetchCards, } = useCardsStore() - const [isOpenBrasilian, setIsOpenBrasilian] = useState(false) + const [isOpenIframe, setIsOpenIframe] = useState(false) const [countryCode, setCountryCode] = useState(null) const { @@ -65,7 +67,7 @@ export const PackageSelectionStep = () => { if (!match) return null - const isBrasil = countryCode?.country_code === 'BR' + const isStripe = payments[client.name] === 'stripe' const getUserCountry = () => { getCountryCode().then(setCountryCode) @@ -75,8 +77,8 @@ export const PackageSelectionStep = () => { cards?.length && lastSelectedPackage === selectedPackage?.id && setDisabledBuyBtn(true) - if (isBrasil) { - setIsOpenBrasilian(true) + if (!isStripe) { + setIsOpenIframe(true) } else { onBuyClick(e) } @@ -110,7 +112,7 @@ export const PackageSelectionStep = () => { - {isBrasil ? null : } + {isStripe && }
{loader ? ( @@ -124,12 +126,13 @@ export const PackageSelectionStep = () => { )}
- {selectedPackage && isOpenBrasilian && ( - )} diff --git a/src/features/CompanyInfo/index.tsx b/src/features/CompanyInfo/index.tsx index 1cc5a30d..f4df3c38 100644 --- a/src/features/CompanyInfo/index.tsx +++ b/src/features/CompanyInfo/index.tsx @@ -39,7 +39,7 @@ export const CompanyInfo = ({ ) - case ClientNames.Tunis: + case ClientNames.Tunisia: return '' case ClientNames.Lff: return ( diff --git a/src/features/HeaderMobile/styled.tsx b/src/features/HeaderMobile/styled.tsx index 64733655..2a91486e 100644 --- a/src/features/HeaderMobile/styled.tsx +++ b/src/features/HeaderMobile/styled.tsx @@ -14,7 +14,7 @@ export const DEFAULT_HEADER_COLOR = 'rgba(53, 96, 225, 0.56)' export const defaultHeaderStyles = ( color: string = DEFAULT_HEADER_COLOR, headerImage: string | undefined | null, ) => { - if (client.name === 'lff') { + if (['lff', 'tunis'].includes(client.name)) { return client.styles.homePageHeader } diff --git a/src/features/HomePage/index.tsx b/src/features/HomePage/index.tsx index e4e476a2..6120b4c8 100644 --- a/src/features/HomePage/index.tsx +++ b/src/features/HomePage/index.tsx @@ -20,6 +20,7 @@ import { useHomePage } from './hooks' import { Header } from './components/Header' import { HeaderMobile } from '../HeaderMobile' import { HeaderFilters } from './components/HeaderFilters' +import { client } from '../../config/clients' const Home = () => { usePageLogger(PAGES.home) @@ -46,7 +47,7 @@ const Home = () => {
- {isMobileDevice ? null : } + {!isMobileDevice && !client.disabledFilters && } { resume, streamUrl, } = useLiveMatch() - return ( diff --git a/src/features/ProfileCard/index.tsx b/src/features/ProfileCard/index.tsx index 43e66854..280f6ed6 100644 --- a/src/features/ProfileCard/index.tsx +++ b/src/features/ProfileCard/index.tsx @@ -5,7 +5,7 @@ import { Link } from 'react-router-dom' import type { ObjectWithName } from 'features/Name' import { PAGES, ProfileTypes } from 'config' -import { client, isLffClient } from 'config/clients' +import { client } from 'config/clients' import { ClientNames } from 'config/clients/types' import { checkPage } from 'helpers/checkPage' @@ -94,7 +94,7 @@ export const ProfileCard = ({ profile }: ProfileType) => { - {!isLffClient && isPlayerPage && isGetHighLightShown && ( + {!client.disabledHighlights && isPlayerPage && isGetHighLightShown && ( setPlayerHighlight({ diff --git a/src/features/ProfileHeader/styled.tsx b/src/features/ProfileHeader/styled.tsx index 2c1f2b2f..7196d670 100644 --- a/src/features/ProfileHeader/styled.tsx +++ b/src/features/ProfileHeader/styled.tsx @@ -13,7 +13,7 @@ export const DEFAULT_HEADER_COLOR = 'rgba(53, 96, 225, 0.56)' export const defaultHeaderStyles = ( color: string = DEFAULT_HEADER_COLOR, headerImage: string | undefined | null, ) => { - if (client.name === 'lff') { + if (['lff', 'tunis'].includes(client.name)) { return client.styles.homePageHeader } diff --git a/src/features/Theme/config.tsx b/src/features/Theme/config.tsx index 3d5de7f7..38a65d88 100644 --- a/src/features/Theme/config.tsx +++ b/src/features/Theme/config.tsx @@ -82,6 +82,18 @@ export const facrTheme: CustomTheme = { name: 'facr', } -type Name = 'light' | 'dark' | 'lff' | 'facr' +export const tunisTheme: CustomTheme = { + ...defaultTheme, + colors: { + ...defaultTheme.colors, + background: '#1D1D1D', + button: '#0E8F84', + dateFilter: '#ffffff80', + inputs: '#3A4849', + }, + name: 'tunis', +} + +type Name = 'light' | 'dark' | 'lff' | 'facr' | 'tunis' export type CustomTheme = typeof lightTheme diff --git a/src/features/Theme/index.tsx b/src/features/Theme/index.tsx index aae58a11..ad899315 100644 --- a/src/features/Theme/index.tsx +++ b/src/features/Theme/index.tsx @@ -13,6 +13,7 @@ import { defaultTheme, facrTheme, lffTheme, + tunisTheme, } from './config' import { ClientNames } from '../../config/clients/types' @@ -31,6 +32,9 @@ export const Theme = ({ children }: Props) => { case ClientNames.Facr: setTheme(facrTheme) break + case ClientNames.Tunisia: + setTheme(tunisTheme) + break default: setTheme(defaultTheme) break diff --git a/src/features/UserAccount/index.tsx b/src/features/UserAccount/index.tsx index 553a5524..b3a5356d 100644 --- a/src/features/UserAccount/index.tsx +++ b/src/features/UserAccount/index.tsx @@ -85,7 +85,7 @@ const UserAccount = () => { )} - {!isLffClient && ( + {!client.disabledHighlights && ( diff --git a/src/requests/getBrazilPaymentUrl.tsx b/src/requests/getPaymentUrl.tsx similarity index 87% rename from src/requests/getBrazilPaymentUrl.tsx rename to src/requests/getPaymentUrl.tsx index 88c5699c..957b3136 100644 --- a/src/requests/getBrazilPaymentUrl.tsx +++ b/src/requests/getPaymentUrl.tsx @@ -8,12 +8,14 @@ type Props = { action: 'one_payment' | 'create_subscription', item: SubscriptionResponse, product_name: string, + service: string, } -export const getBrazilPaymentUrl = async ({ +export const getPaymentUrl = async ({ action, item, product_name, + service, }: Props) => { const config = { body: { @@ -22,7 +24,7 @@ export const getBrazilPaymentUrl = async ({ item: { ...item, product_name }, url_return: `${window.location.origin}${PAGES.thanksForSubscribe}`, }, - service: 'pag_brasil', + service, }, }