From 65d5ad9f4828398f6474206ac4dbfd14ef43b291 Mon Sep 17 00:00:00 2001 From: konstantinosG-deriv <104083272+konstantinosG-deriv@users.noreply.github.com> Date: Wed, 9 Aug 2023 08:11:39 +0200 Subject: [PATCH] Konstantinos / Delay fix (#5331) * fix: floating disclaimer EU update * fix: revert * fix: 404 update * fix: revert * fix: delay remove for cfdwarningbanner --------- Co-authored-by: Konstantinos-Gk --- .../components/molecules/layout-overlay/index.tsx | 9 ++++++--- src/features/components/templates/layout/index.tsx | 7 +------ src/translations/ach.json | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/features/components/molecules/layout-overlay/index.tsx b/src/features/components/molecules/layout-overlay/index.tsx index fb10df5db85..e11af1adf31 100644 --- a/src/features/components/molecules/layout-overlay/index.tsx +++ b/src/features/components/molecules/layout-overlay/index.tsx @@ -1,13 +1,16 @@ import React from 'react' +import pMinDelay from 'p-min-delay' +import loadable from '@loadable/component' import { overlay_container } from './layout-overlay.module.scss' -import LiveChatButton from './live-chat-button' -import WhatsappButton from './whats-app-button' -import CookieBanner from './cookie-banner' import CfdWarningBanner from './cfd-warning-banner' import Flex from 'features/components/atoms/flex-box' import { useIsRtl } from 'components/hooks/use-isrtl' import { getLocationPathname } from 'common/utility' +const LiveChatButton = loadable(() => pMinDelay(import('./live-chat-button'), 5000)) +const WhatsappButton = loadable(() => pMinDelay(import('./whats-app-button'), 5000)) +const CookieBanner = loadable(() => pMinDelay(import('./cookie-banner'), 5000)) + const LayoutOverlay = () => { const is_rtl = useIsRtl() diff --git a/src/features/components/templates/layout/index.tsx b/src/features/components/templates/layout/index.tsx index 079df6f7487..770d6379583 100644 --- a/src/features/components/templates/layout/index.tsx +++ b/src/features/components/templates/layout/index.tsx @@ -1,17 +1,12 @@ import React, { ReactNode } from 'react' -import loadable from '@loadable/component' -import pMinDelay from 'p-min-delay' import { usePlatformQueryParam } from 'components/hooks/use-platform-query-param' import PpcProvider from 'features/contexts/ppc-campaign/ppc.provider' import { getLanguage, isBrowser } from 'common/utility' +import LayoutOverlay from 'features/components/molecules/layout-overlay' import BrowserUpdateAlert from 'features/components/molecules/browser-update-alert' import apiManager from 'common/websocket' import 'swiper/swiper-bundle.min.css' import 'features/styles/app.scss' - -const LayoutOverlay = loadable(() => - pMinDelay(import('features/components/molecules/layout-overlay'), 5000), -) interface LayoutProps { is_ppc?: boolean is_ppc_redirect?: boolean diff --git a/src/translations/ach.json b/src/translations/ach.json index 6bc0d4aadc2..cc57a66e592 100644 --- a/src/translations/ach.json +++ b/src/translations/ach.json @@ -3901,4 +3901,4 @@ "-1773685845": "crwdns459760:0crwdne459760:0", "-661813412": "crwdns459762:0crwdne459762:0", "-1520902282": "crwdns459764:0crwdne459764:0" -} +} \ No newline at end of file