From d0bcb49a29d7c5377ac9c2178b12aeb3034a118b Mon Sep 17 00:00:00 2001 From: Rakov Roman Date: Wed, 15 Feb 2023 15:37:03 +0300 Subject: [PATCH] fix(#188): fix pr commits --- src/features/AuthStore/helpers.tsx | 13 +++++++++---- src/features/HomePage/index.tsx | 1 - src/features/ProfileCard/index.tsx | 2 +- src/pages/DiwanInsportsTv/index.tsx | 6 +++--- src/pages/DiwanInsportsTv/styled.tsx | 3 +-- src/pages/FailedPaymeePage/index.tsx | 14 +++++++++----- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index c2fd3612..50818c4f 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -36,15 +36,20 @@ export const getClientNameByRedirectUri = () => { } } +const clientsForRedirect = { + facr: ClientNames.Facr, + india: ClientNames.India, + lff: ClientNames.Lff, + tunisia: ClientNames.Tunisia, +} + const redirectUrl = () => { const clientName = getClientNameByRedirectUri() switch (true) { case ( process.env.NODE_ENV === 'development' - || client.name === 'lff' - || client.name === 'facr' - || client.name === 'india' - || client.name === 'tunisia' + // @ts-ignore + || Boolean(clientsForRedirect[client.name]) ): return `${window.origin}/redirect` case (ENV === 'staging' || ENV === 'preproduction'): diff --git a/src/features/HomePage/index.tsx b/src/features/HomePage/index.tsx index bc87781d..f5d94791 100644 --- a/src/features/HomePage/index.tsx +++ b/src/features/HomePage/index.tsx @@ -20,7 +20,6 @@ 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) diff --git a/src/features/ProfileCard/index.tsx b/src/features/ProfileCard/index.tsx index 96e40724..a59f7ed1 100644 --- a/src/features/ProfileCard/index.tsx +++ b/src/features/ProfileCard/index.tsx @@ -9,7 +9,7 @@ import { ProfileTypes, URL_AWS, } from 'config' -import { client, isLffClient } from 'config/clients' +import { client } from 'config/clients' import { ClientNames } from 'config/clients/types' import { checkPage } from 'helpers/checkPage' diff --git a/src/pages/DiwanInsportsTv/index.tsx b/src/pages/DiwanInsportsTv/index.tsx index a4e2cc7c..a2a77b1b 100644 --- a/src/pages/DiwanInsportsTv/index.tsx +++ b/src/pages/DiwanInsportsTv/index.tsx @@ -1,7 +1,5 @@ import { Fragment } from 'react' -import format from 'date-fns/format' - import { isMobileDevice } from 'config' import { joinMatchLexics } from 'config/lexics/joinMatch' @@ -10,6 +8,8 @@ import { useLexicsConfig } from 'features/LexicsStore' import { useAuthStore } from 'features/AuthStore' +import { getCurrentYear } from 'helpers' + import { Wrapper, TunisiaLogo, @@ -34,7 +34,7 @@ export const DiwanInsportsTv = () => { useLexicsConfig(joinMatchLexics) const { login } = useAuthStore() - const currentYear = format(new Date(), 'Y') + const currentYear = getCurrentYear() return ( diff --git a/src/pages/DiwanInsportsTv/styled.tsx b/src/pages/DiwanInsportsTv/styled.tsx index 37bfbb9a..da2d4e71 100644 --- a/src/pages/DiwanInsportsTv/styled.tsx +++ b/src/pages/DiwanInsportsTv/styled.tsx @@ -1,7 +1,6 @@ import styled, { css } from 'styled-components/macro' -import { devices } from 'config' -import { isMobileDevice } from 'config/userAgent' +import { devices, isMobileDevice } from 'config' import { ButtonSolid } from 'features/Common' diff --git a/src/pages/FailedPaymeePage/index.tsx b/src/pages/FailedPaymeePage/index.tsx index fe3ab4bb..30658779 100644 --- a/src/pages/FailedPaymeePage/index.tsx +++ b/src/pages/FailedPaymeePage/index.tsx @@ -4,10 +4,14 @@ import { FailedPaymeeWrapper } from './styled' // эта страница рассчитана на открытие во фрейме // при неудачной оплате paymee -const FailedPaymeePage = () => ( - - - -) +const FailedPaymeePage = () => { + const iframeZendesk = document.querySelector('#launcher') as HTMLElement + if (iframeZendesk) iframeZendesk.style.display = 'none' + return ( + + + + ) +} export default FailedPaymeePage