Skip to content

Commit

Permalink
fix: show cfd banner only in home page (binary-com#5368)
Browse files Browse the repository at this point in the history
* fix: show cfd banner only in home page

* fix: remove layout conditions
  • Loading branch information
Nuzhy-Deriv authored Aug 9, 2023
1 parent f89affa commit 66bd5db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/features/components/molecules/layout-overlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ 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 LayoutOverlay = () => {
const is_rtl = useIsRtl()

const isHomePage = () => {
return getLocationPathname() === '/'
}
return (
<Flex.Box
id="overlay-container"
Expand All @@ -33,7 +38,7 @@ const LayoutOverlay = () => {
<WhatsappButton />
</Flex.Box>
</Flex.Box>
<CfdWarningBanner />
{isHomePage() && <CfdWarningBanner />}
</Flex.Box>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/features/pages/signup-success/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { signup_success_wrapper, signup_success_description } from './signup-success.module.scss'
import { SEO } from 'components/containers'
import Layout from 'components/layout/layout'
import Layout from 'features/components/templates/layout'
import StaticNav from 'features/components/templates/navigation/static-nav'
import Flex from 'features/components/atoms/flex-box'
import Typography from 'features/components/atoms/typography'
Expand All @@ -16,7 +16,7 @@ type SignupProps = {

const SignUpSuccessContainer = ({ email }: SignupProps) => {
return (
<Layout show_footer={false}>
<Layout>
<SEO
title="_t_Easy And Free Sign Up | Online Trading | Deriv.com_t_"
description="_t_Signup to Deriv.com and trade online with as little as $1 USD on major currencies, stocks, indices, and commodities._t_"
Expand Down
4 changes: 2 additions & 2 deletions src/features/pages/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React from 'react'
import { signup_wrapper } from './signup.module.scss'
import SignUpContent from './signup.content'
import SignUpFormContainer from './form-container'
import Layout from 'components/layout/layout'
import Layout from 'features/components/templates/layout'
import StaticNav from 'features/components/templates/navigation/static-nav'
import { SEO } from 'components/containers'
import Flex from 'features/components/atoms/flex-box'

const SignUp = () => {
return (
<Layout show_footer={false}>
<Layout>
<SEO
title="_t_Easy And Free Sign Up | Online Trading | Deriv.com_t_"
description="_t_Signup to Deriv.com and trade online with as little as $1 USD on major currencies, stocks, indices, and commodities._t_"
Expand Down

0 comments on commit 66bd5db

Please sign in to comment.