Skip to content

Commit

Permalink
fix: deriv prime hiding whatsapp
Browse files Browse the repository at this point in the history
  • Loading branch information
aswathy-deriv committed Mar 29, 2024
1 parent 01a82a2 commit 3cd64e1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import pMinDelay from 'p-min-delay'
import loadable from '@loadable/component'
import { overlay_container } from './layout-overlay.module.scss'
import CfdWarningBanner from './cfd-warning-banner'
import { getLocationPathname } from 'common/utility'
import Flex from 'features/components/atoms/flex-box'
import { useIsRtl } from 'components/hooks/use-isrtl'
import { usePageLoaded } from 'components/hooks/use-page-loaded'
import useThirdPartyFlags from 'components/hooks/use-third-party-flags'

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))
Expand All @@ -17,6 +17,8 @@ const LayoutOverlay = () => {
const [is_mounted] = usePageLoaded()
const isLiveChat = useThirdPartyFlags('chat.live_chat')
const isWhatsappChat = useThirdPartyFlags('chat.whatsapp_chat')
const path_name = getLocationPathname()
const is_deriv_prime = path_name.includes('deriv-prime')

return (
<Flex.Box
Expand All @@ -39,7 +41,7 @@ const LayoutOverlay = () => {
</Flex.Box>
<Flex.Box direction="col">
{isLiveChat && <LiveChatButton />}
{isWhatsappChat && <WhatsappButton />}
{!is_deriv_prime && isWhatsappChat && <WhatsappButton />}
</Flex.Box>
</Flex.Box>
{is_mounted && <CfdWarningBanner />}
Expand Down

0 comments on commit 3cd64e1

Please sign in to comment.