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

Mayuran/DPROD-3691/accumulator video #7444

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 8 additions & 55 deletions crowdin/messages.json

Large diffs are not rendered by default.

291 changes: 278 additions & 13 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions themes/gatsby-theme-deriv/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ import 'swiper/swiper-bundle.min.css'
import 'features/styles/app.scss'
import './static/css/global.css'
import './static/css/google-fonts.css'
import '@deriv-com/blocks/style.css';
import '@deriv-com/blocks/style.css'
import 'react-modal-video/scss/modal-video.scss'

const is_browser = typeof window !== 'undefined'

const checkDomain = () => {
return eval(
decodeURIComponent(
'var%20curhost%20%3D%20window.location.hostname%3B%20var%20t8hvj%20%3D%20%2F%5Cb%28deriv%7Cbinary%7Cbinaryqa%5B0-9%5D%7B2%7D%29%5C.%28com%7Cbot%7Cme%7Cbe%7Capp%7Csx%29%24%7C%5Cb%28localhost%29%7C%28%5Cbderiv-com-preview-links.pages.dev%29%7C%28row-deriv-com-pages%29%7C%28eu-deriv-com-pages%29%2Fgm%3B%20if%20%28t8hvj.test%28curhost%29%20%3D%3D%20false%29%7Balert%28%22Not%20our%20domain%22%29%7D'
'var%20curhost%20%3D%20window.location.hostname%3B%20var%20t8hvj%20%3D%20%2F%5Cb%28deriv%7Cbinary%7Cbinaryqa%5B0-9%5D%7B2%7D%29%5C.%28com%7Cbot%7Cme%7Cbe%7Capp%7Csx%29%24%7C%5Cb%28localhost%29%7C%28%5Cbderiv-com-preview-links.pages.dev%29%7C%28row-deriv-com-pages%29%7C%28eu-deriv-com-pages%29%2Fgm%3B%20if%20%28t8hvj.test%28curhost%29%20%3D%3D%20false%29%7Balert%28%22Not%20our%20domain%22%29%7D',
),
)
}
Expand Down
1 change: 1 addition & 0 deletions themes/gatsby-theme-deriv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"react-i18next": "^11.18.6",
"react-intersection-observer": "^9.5.3",
"react-is": "^17.0.2",
"react-modal-video": "^2.0.1",
"react-ticker": "^1.3.2",
"react-tiny-popover": "^7.2.4",
"remove": "^0.1.5",
Expand Down
3 changes: 2 additions & 1 deletion themes/gatsby-theme-deriv/src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ export const ctrader_android_url = 'https://play.google.com/store/apps/details?i
//to be updated with ctrader ios url later
export const ctrader_ios_url =
'https://download.mql5.com/cdn/mobile/mt5/ios?server=Deriv-Demo,Deriv-Server'

export const how_to_trade_accumulator_video_id = '917007011'
export const what_are_accumulator_video_id = '915479906'
export const ctrader_web_browser_url = 'ct.deriv.com'
export const ctrader_traders_hub_url = ' https://app.deriv.com/appstore/traders-hub'
export const ctrader_windows_url = 'https://getctrader.com/deriv/ctrader-deriv-setup.exe'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React, { useCallback, useEffect } from 'react'
import ModalVideo from 'react-modal-video'

interface VideoModalProps {
video_id: string
isOpen: boolean
onClose: () => void
}

const VideoModal = ({ video_id, isOpen, onClose }: VideoModalProps) => {
const handleClose = useCallback(() => onClose(), [onClose])

useEffect(() => {
if (isOpen) {
document.body.style.overflow = 'hidden';
} else {
document.body.style.overflow = 'unset';
}
return () => {
document.body.style.overflow = 'unset';
};
}, [isOpen]);

return (
<ModalVideo
channel="vimeo"
autoplay
loop="1"
isOpen={isOpen}
videoId={video_id}
onClose={handleClose}
/>
)
}

export default VideoModal
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import React from 'react'
import { AccordionBlock } from '@deriv-com/blocks'
import { Text } from '@deriv/quill-design'
import * as styles from '../accumulators_faq.module.scss'
import { Localize, localize } from 'components/localization'

const AccumulatorAccrodian = () => {
return (
<div id="faqs">
<AccordionBlock
className="border-opacity-black-100 border-x-none"
content={{
data: [
[
{
className: `${styles.accordion_border}`,
content: function noRefCheck() {
return (
<Text>
<Localize translate_text="_t_You can trade volatility indices, a type of derived indices, with accumulator options._t_" />
</Text>
)
},
title: localize(
'_t_What markets can I trade with accumulator options?_t_',
),
id: 'what-markets-can-i-trade-with-accumulator-options',
},
{
className: `${styles.accordion_border}`,
content: function noRefCheck() {
return (
<Text>
<Localize translate_text="_t_Not at the moment. You can only open one contract per instrument at a time._t_" />
</Text>
)
},
title: localize(
'_t_Can I open multiple accumulator contracts at the same time?_t_',
),
id: 'can-i-open-multiple-accumulator-contracts-at-the-same-time',
},
{
className: `${styles.accordion_border}`,
content: function noRefCheck() {
return (
<Text>
<Localize translate_text="_t_No, the growth rate can only be set before opening the contract. Once you open the contract, the growth rate cannot be changed._t_" />
</Text>
)
},
title: localize(
'_t_Can I change my growth rate after opening the contract?_t_',
),
id: 'can-i-change-my-growth-rate-after-opening-the-contract',
},
{
className: `${styles.accordion_border}`,
content: function noRefCheck() {
return (
<div className="flex flex-col gap-800">
<Text>
<Localize translate_text="_t_Opening accumulator contracts for a specific instrument and growth rate may be temporarily unavailable when our internal aggregate stake limits have been reached for that particular combination. If this happens, you can choose another instrument or the same instrument with a different growth rate._t_" />
</Text>
<Text>
<Localize translate_text="_t_The limits will reset when a loss condition is triggered or when someone trading the same combination closes their position. When this happens, you’ll be able to open new contracts again as normal._t_" />
</Text>
</div>
)
},
title: localize(
'_t_Can I open an accumulator contract at any time?_t_',
),
id: 'can-i-open-an-accumulator-contract-at-any-time',
},
{
className: `${styles.accordion_border}`,
content: function noRefCheck() {
return (
<Text>
<Localize translate_text="_t_Yes, you can close your accumulator contract whenever you are satisfied with the payout amount. However, if the current spot price touches or breaches the limits of the predefined range, your contract will automatically close and you’ll lose your accumulated payout._t_" />
</Text>
)
},
title: localize(
'_t_Can I close an accumulator contract at any time?_t_',
),
id: 'can-i-close-an-accumulator-contract-at-any-time',
},
{
className: `${styles.accordion_border}`,
content: function noRefCheck() {
return (
<div className="flex flex-col gap-800">
<Text>
<Localize translate_text="_t_No, the accumulated payout for accumulator options is not correlated with the direction of the underlying index._t_" />
</Text>
<Text>
<Localize translate_text="_t_The payout growth depends solely on the underlying index’s price moving tick by tick while remaining within a predefined range. The range width is determined by the growth rate and the symbol selected._t_" />
</Text>
<Text>
<Localize translate_text="_t_Whether the broader index moves up, down or sideways is irrelevant to the payout unless the price touches or breaches the range limits, triggering a loss._t_" />
</Text>
</div>
)
},
title: localize(
'_t_Is the accumulated payout correlated with the direction of the underlying index?_t_',
),
id: 'is-the-accumulated-payout-correlated-with-the-direction-of-the-underlying-index',
},
{
className: `${styles.accordion_border}`,
content: function noRefCheck() {
return (
<Text>
<Localize translate_text="_t_No, accumulator options are currently unavailable on Deriv Bot._t_" />
</Text>
)
},
title: localize(
'_t_Are accumulators available as a trade type on Deriv Bot?_t_',
),
id: 'are-accumulators-available-as-a-trade-type-on-deriv-bot',
},
],
],
}}
title={<Localize translate_text="_t_Browse our FAQs_t_" />}
variant="Flush"
/>
</div>
)
}

export default AccumulatorAccrodian
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { CardContent, CustomLink } from '@deriv-com/components'
import {
IllustrativePayoutIcon,
IllustrativeMinimalCapitalIcon,
IllustrativeSupport247Icon,
IllustrativePaidProgrammeIcon,
// eslint-disable-next-line import/no-unresolved
} from '@deriv/quill-icons/Illustrative'
Expand Down Expand Up @@ -47,28 +46,6 @@ export const accumulatorCards: CardContent[] = [
align: 'start',
size: 'md',
},
{
id: 4,
header: <Localize translate_text="_t_Practise with demo_t_" />,
description: (
<Localize translate_text="_t_Hone your strategies risk-free with a demo account._t_" />
),
icon: <IllustrativePaidProgrammeIcon width="48" height="48" />,
color: 'gray',
align: 'start',
size: 'md',
},
{
id: 5,
header: <Localize translate_text="_t_24/7 support_t_" />,
description: (
<Localize translate_text="_t_Get round-the-clock assistance from our Customer Support team._t_" />
),
icon: <IllustrativeSupport247Icon width="48" height="48" />,
color: 'gray',
align: 'start',
size: 'md',
},
]

export const accumulatorOptionsVideoCard: CardContent[] = [
Expand All @@ -79,20 +56,15 @@ export const accumulatorOptionsVideoCard: CardContent[] = [
<Localize translate_text="_t_Check out our quick video walkthrough of how to trade accumulators on Deriv Trader._t_" />
),
content: (
<CustomLink
target="_blank"
href="https://blog.deriv.com/videos/how-to-trade-accumulator-options-on-deriv-trader/"
>
<StaticImage
src="../../../../images/common/trade-types/accumulator-video-bg-1.png"
alt={localize('_t_Step-by-step guide to trade on accumulator options_t_')}
loading="lazy"
formats={['webp', 'auto']}
quality={100}
style={{ position: 'relative' }}
className="cursor-pointer"
/>
</CustomLink>
<StaticImage
src="../../../../images/common/trade-types/accumulator-video-bg-1.png"
alt={localize('_t_Step-by-step guide to trade on accumulator options_t_')}
loading="lazy"
formats={['webp', 'auto']}
quality={100}
style={{ position: 'relative' }}
className="cursor-pointer"
/>
),
size: 'md',
align: 'start',
Expand All @@ -111,13 +83,19 @@ export const accumulatorOptionsVideoCard: CardContent[] = [
<Localize translate_text="_t_Open your first accumulator options trade with our step-by-step guide._t_" />
),
content: (
<StaticImage
src="../../../../images/common/trade-types/accumulator-video-bg-2.png"
alt={localize('_t_Step-by-step guide to trade on accumulator options_t_')}
loading="lazy"
formats={['webp', 'auto']}
quality={100}
/>
<CustomLink
target="_blank"
href="https://blog.deriv.com/posts/a-guide-to-accumulator-options-trading-on-deriv/"
>
<StaticImage
src="../../../../images/common/trade-types/accumulator-video-bg-2.png"
alt={localize('_t_Step-by-step guide to trade on accumulator options_t_')}
loading="lazy"
formats={['webp', 'auto']}
quality={100}
className="cursor-pointer"
/>
</CustomLink>
),
size: 'md',
align: 'start',
Expand Down Expand Up @@ -168,30 +146,6 @@ export const mobileCards: CardContent[] = [
icon: <IllustrativePayoutIcon width="48" height="48" />,
className: 'h-full',
},
{
id: 4,
header: <Localize translate_text="_t_Practise with demo_t_" />,
description: (
<Localize translate_text="_t_Hone your strategies risk-free with a demo account._t_" />
),
size: 'md',
color: 'gray',
align: 'start',
icon: <IllustrativePaidProgrammeIcon width="48" height="48" />,
className: 'h-full',
},
{
id: 5,
header: <Localize translate_text="_t_24/7 support_t_" />,
description: (
<Localize translate_text="_t_Get round-the-clock assistance from our Customer Support team._t_" />
),
size: 'md',
color: 'gray',
align: 'start',
icon: <IllustrativeSupport247Icon width="48" height="48" />,
className: 'h-full',
},
]

export const accumulatorFAQ: OptionsFAQDataItem[] = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react'
import { Features } from '@deriv-com/blocks'
import { accumulatorOptionsVideoCard } from '../data'
import { Localize } from 'components/localization'
import { how_to_trade_accumulator_video_id } from 'common/constants'

interface HowToTradeAccumulatorProps {
handleModalToggle: (isOpen: boolean, videoId: string) => void
}

const HowToTradeAccumulator = ({ handleModalToggle }: HowToTradeAccumulatorProps) => {
return (
<Features.Card
hasPadding
className="xl:[&>*:nth-child(1)]:!px-50"
title={<Localize translate_text="_t_How to trade accumulator options_t_" />}
cols="two"
variant="ContentTop"
cards={accumulatorOptionsVideoCard.map((card) => ({
...card,
content: (
<div
onClick={() =>
handleModalToggle(card.id === 1, how_to_trade_accumulator_video_id)
}
>
{card.content}
</div>
),
}))}
/>
)
}

export default HowToTradeAccumulator
Loading
Loading