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

Commit

Permalink
Konstantinos / Unavailable services for EU, should be unavailable in …
Browse files Browse the repository at this point in the history
…help center as well (#5708)

* fix: help centre eu rendering

* fix: use ProtectedRoute component

* fix: dbot

---------

Co-authored-by: Konstantinos-Gk <[email protected]>
  • Loading branch information
konstantinosG-deriv and Konstantinos-Gk authored Sep 29, 2023
1 parent ebc191d commit 2cef71d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
13 changes: 12 additions & 1 deletion src/pages/help-centre/deriv-bot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ import dbot from './data/_dbot'
import { WithIntl } from 'components/localization'
import { SEO } from 'components/containers'
import { TGatsbyHead } from 'features/types'
import useRegion from 'components/hooks/use-region'
import ProtectedRoute from 'features/components/molecules/protected-route'

const DBot = () => <QuestionsTemplate data={dbot} />
const DBot = () => {
const { is_eu, is_region_loading } = useRegion()

return (
<ProtectedRoute
is_page_visible={!is_eu}
component={<QuestionsTemplate data={dbot} />}
is_loading={is_region_loading}
/>
)
}
export default WithIntl()(DBot)

export const Head = ({ pageContext }: TGatsbyHead) => (
Expand Down
13 changes: 12 additions & 1 deletion src/pages/help-centre/deriv-ez.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ import deriv_ez from './data/_deriv-ez'
import { WithIntl } from 'components/localization'
import { SEO } from 'components/containers'
import { TGatsbyHead } from 'features/types'
import useRegion from 'components/hooks/use-region'
import ProtectedRoute from 'features/components/molecules/protected-route'

const DerivEZ = () => <QuestionsTemplate data={deriv_ez} />
const DerivEZ = () => {
const { is_eu, is_region_loading } = useRegion()

return (
<ProtectedRoute
is_page_visible={!is_eu}
component={<QuestionsTemplate data={deriv_ez} />}
is_loading={is_region_loading}
/>
)
}
export default WithIntl()(DerivEZ)

export const Head = ({ pageContext }: TGatsbyHead) => (
Expand Down
14 changes: 13 additions & 1 deletion src/pages/help-centre/deriv-p2p.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ import deriv_p2p from './data/_deriv-p2p'
import { WithIntl } from 'components/localization'
import { SEO } from 'components/containers'
import { TGatsbyHead } from 'features/types'
import ProtectedRoute from 'features/components/molecules/protected-route'
import useRegion from 'components/hooks/use-region'

const DerivP2P = () => <QuestionsTemplate data={deriv_p2p} />
const DerivP2P = () => {
const { is_eu, is_region_loading } = useRegion()

return (
<ProtectedRoute
is_page_visible={!is_eu}
component={<QuestionsTemplate data={deriv_p2p} />}
is_loading={is_region_loading}
/>
)
}

export default WithIntl()(DerivP2P)

Expand Down
13 changes: 12 additions & 1 deletion src/pages/help-centre/deriv-x.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ import derivx from './data/_deriv-x'
import { WithIntl } from 'components/localization'
import { SEO } from 'components/containers'
import { TGatsbyHead } from 'features/types'
import useRegion from 'components/hooks/use-region'
import ProtectedRoute from 'features/components/molecules/protected-route'

const DerivX = () => <QuestionsTemplate data={derivx} />
const DerivX = () => {
const { is_eu, is_region_loading } = useRegion()

return (
<ProtectedRoute
is_page_visible={!is_eu}
component={<QuestionsTemplate data={derivx} />}
is_loading={is_region_loading}
/>
)
}
export default WithIntl()(DerivX)

export const Head = ({ pageContext }: TGatsbyHead) => (
Expand Down

1 comment on commit 2cef71d

@vercel
Copy link

@vercel vercel bot commented on 2cef71d Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-com – ./

deriv-com-git-master.binary.sx
deriv-com.binary.sx

Please sign in to comment.