Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

[CRO] Amir/CRO-514/signup experimental page #7635

Merged
merged 11 commits into from
Apr 30, 2024
129 changes: 75 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions themes/gatsby-theme-deriv/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import Cookies from 'js-cookie'
import { isMobile } from 'react-device-detect'
import { Analytics } from '@deriv-com/analytics'
import { navigate } from 'gatsby'
import { WrapPagesWithLocaleContext } from './src/components/localization'
import { isProduction } from './src/common/websocket/config'
import { LocalStore } from './src/common/storage'
Expand Down Expand Up @@ -91,6 +92,10 @@ export const onClientEntry = () => {
)
? process.env.GATSBY_RUDDERSTACK_STAGING_KEY
: process.env.GATSBY_RUDDERSTACK_PRODUCTION_KEY,
growthbookOptions: {
navigate: (url) => navigate(url, { replace: true }),
navigateDelay: 0,
},
})
const utm_data = JSON?.parse(
Cookies?.get('utm_data') ||
Expand Down
2 changes: 1 addition & 1 deletion themes/gatsby-theme-deriv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@artsy/fresnel": "^6.2.1",
"@builder.io/partytown": "^0.8.1",
"@deriv-com/analytics": "^1.4.10",
"@deriv-com/analytics": "^1.5.0-beta",
"@deriv-com/blocks": "^0.118.0",
"@deriv-com/components": "^0.59.0",
"@deriv-com/hooks": "^0.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ const WarningBanner = loadable(() =>
pMinDelay(import('features/components/quill/layout-overlay/warnings-alerts'), 5000),
)

const LayoutOverlay = () => {
const defaultProps = {
hide_live_chat: false,
}

const LayoutOverlay = ({ hide_live_chat }: { hide_live_chat: boolean } = defaultProps) => {
const cookie = useCookieBanner()
const is_rtl = useIsRtl()
const isLiveChat = useThirdPartyFlags('chat.live_chat')
Expand Down Expand Up @@ -52,10 +56,12 @@ const LayoutOverlay = () => {
<WarningBanner trigger_warning_popuop={trigger_warning_popuop} />
</Flex.Box>

<Flex.Box direction="col">
{isLiveChat && <LiveChatButton />}
{!is_deriv_prime && isWhatsappChat && <WhatsappButton />}
</Flex.Box>
{!hide_live_chat && (
<Flex.Box direction="col">
{isLiveChat && <LiveChatButton />}
{!is_deriv_prime && isWhatsappChat && <WhatsappButton />}
</Flex.Box>
)}
</Flex.Box>
</Flex.Box>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface LayoutProps {
is_ppc?: boolean
is_ppc_redirect?: boolean
hide_layout_overlay?: boolean
hide_live_chat?: boolean
children: ReactNode
region: BuildVariantContextType['region']
}
Expand All @@ -35,6 +36,7 @@ const Layout = ({
is_ppc_redirect = false,
hide_layout_overlay = false,
region = 'row',
hide_live_chat = false,
}: LayoutProps) => {
const { has_platform } = usePlatformQueryParam()

Expand Down Expand Up @@ -64,6 +66,8 @@ const Layout = ({
return <>{children}</>
}

console.log({ hide_layout_overlay }, '=====> ')
amir-deriv marked this conversation as resolved.
Show resolved Hide resolved

return (
<BuildVariantProvider region={region}>
<SharedLinkProvider DerivLink={GatsbySharedLink}>
Expand All @@ -73,10 +77,10 @@ const Layout = ({
onLangSelect={onLanguageChange}
activeLanguage={activeLang}
>
<WarningBanner/>
<WarningBanner />
<main className={main_wrapper}>{children}</main>
<BrowserUpdateAlert />
{!hide_layout_overlay && <LayoutOverlay />}
{!hide_layout_overlay && <LayoutOverlay hide_live_chat={hide_live_chat} />}
</LanguageProvider>
</PpcProvider>
</SharedLinkProvider>
Expand Down
Loading
Loading