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

Commit

Permalink
Mayuran/DPROD-3691/accumulator video (#7444)
Browse files Browse the repository at this point in the history
* fix: video accumulator

* fix: remove redirection

* fix: fixes

* fix: modal

* fix: added styles

* fix: comments and updated with design

* fix: remove cards

* fix: bugs

* fix: rtl

* fix: build issue
  • Loading branch information
mayuran-deriv authored Apr 18, 2024
1 parent 0613e4e commit 8140f25
Show file tree
Hide file tree
Showing 14 changed files with 702 additions and 350 deletions.
15 changes: 7 additions & 8 deletions crowdin/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,6 @@
"666057433": "Trade popular assets in the commodities market such as silver, gold, oil, and more without owning the underlying asset. Speculate on the price movements and benefit from our high leverage and competitive spreads.",
"666146179": "Financial institutions",
"666585046": "Choose your growth rate to tailor risk/reward. ",
"667092266": "Get round-the-clock assistance from our Customer Support team.",
"668322984": "Automated copying – no extra work from you.",
"671884384": "Trade the commodities market and speculate on the price movements of oil and precious metals like gold and silver. Enjoy low spreads and zero commission.",
"672008428": "ZEC/USD",
Expand Down Expand Up @@ -1386,7 +1385,6 @@
"1363645836": "Derived FX",
"1364296672": "We will price and settle all contracts accurately and fairly, based on reliable data feeds and without undue delay, so that customers can trust our prices throughout the website.",
"1364677622": "These indices correspond to simulated markets with <0>constant volatilities of 150%, and 250%.</0>",
"1364806512": "Practise with demo",
"1364947573": "Dtrader artboard",
"1364958515": "Stocks",
"1364972610": "How do High/Low Ticks contracts work?",
Expand Down Expand Up @@ -1827,6 +1825,7 @@
"1743279813": "Why trade with Deriv cTrader",
"1743448290": "Payment agents",
"1744940662": "Best Forex Broker Latin America",
"1745188468": "what are trade accumulator options",
"1745193633": "Redirect notice",
"1746051371": "Download the app",
"1746052061": "> 5 - 10 billion",
Expand Down Expand Up @@ -3278,23 +3277,23 @@
"-519772806": "Smart and friendly support, 7 days a week",
"-2015932855": "smart and friendly support",
"-1690667791": "Why trade ETFs on Deriv",
"-2039405840": "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.",
"-390687537": "No, accumulator options are currently unavailable on Deriv Bot.",
"-2143632826": "Browse our FAQs",
"-232157320": "Fast-paced action with durations up to 230 ticks.",
"-844197189": "Controlled Risk",
"-467264818": "Hone your strategies risk-free with a demo account.",
"-1882861283": "Watch: Accumulator options in action",
"-652680277": "Step-by-step guide to trade on accumulator options",
"-712487889": "Read: Guide to trading accumulator options",
"-1923211546": "Open your first accumulator options trade with our step-by-step guide.",
"-1833614673": "How to trade accumulator options",
"-1627820643": "Move fast,<br/>when the market doesn’t",
"-360691661": "Looking for a fast-paced, strategic and potentially explosive way to trade?",
"-244980648": "What are accumulator options?",
"-1356285247": "Accumulator options icon",
"-1500514644": "Accumulator",
"-1167572902": "Secure your gains with manual or automatic profit-taking. With durations of up to 230 ticks, accumulator options are ideal for those looking for fast-paced, strategic trades while balancing risk and reward.",
"-1833614673": "How to trade accumulator options",
"-2039405840": "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.",
"-390687537": "No, accumulator options are currently unavailable on Deriv Bot.",
"-2143632826": "Browse our FAQs",
"-319687255": "Deriv GO",
"-360691661": "Looking for a fast-paced, strategic and potentially explosive way to trade?",
"-1759381505": "What are turbo options?",
"-1461784880": "How do vanilla options work?",
"-231290085": "Start connecting with fellow traders to make deposits and withdrawals.",
Expand Down
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 @@ -130,7 +130,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
Loading

0 comments on commit 8140f25

Please sign in to comment.