Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 1552093

Browse files
mustofa-binaryvirtualpowwasara-fssara-fsKevin
authored
Crowdin (#1242)
* Kevin/ Add Tradertools page (calculators) (#1125) * Sara / Update commission text (#1132) * Removed up to * Removed up to from who-can-apply Co-authored-by: sara-fs <[email protected]> * Kevin/Update multiplier content (#1134) * feat:update multiplier content * fix:resolve PR comments * fix:Qa comments * fix:Qa comments #2 * fix:qa comments #3 * fix:qa issues * fix: Qa comments * update: image and fix qa comments * fix:margin problem on text * update: messages.json ( translation:extract ) Co-authored-by: Kevin <[email protected]> * fix: updated text for UK and non-UK clients (#1146) * text:update eu footer content (#1141) Co-authored-by: Kevin <[email protected]> * text:add apostrophe on option description (#1120) Co-authored-by: Kevin <[email protected]> * text: update hero content (#1139) Co-authored-by: Kevin <[email protected]> * translate:extract upload download * translate: download * translate: download chinese * amam/add_fiat_onramp (#1164) * feat: add onramp payment methods * update: hide wyre and xanpool for now Co-authored-by: mustofa-binary <[email protected]> * translate: download * feat: trader-tools-page-calculators * feat: handleError onclick for X icon * fix:PR#1 * Fix:PR comments#2 * fix:PR - make use of Flex component instead of div * fix: handle error, and buttond default disabled * Fix: Qa comments #4 & add symbols * fix: update validation text * fix:margin to show decimal if necessary * fix: minor styling * remove: unecessary duplicate validation * fix:PR comments : update validation, and styling * fix: code review * update:dropdown * fix qa comments * improve: styling and fix qa comment * fix: max 2 digit decimals input, refactor validation, calculate bug * fix: placeholder issue * fix: placeholder issue * fix: issue 35,36,37 * fix: issue 35,36,37 * remove: max 2 input decimal * resolve: qa comments * remove extra 0 on submit * fix: qa comment focus on clicked error * removed selected symbol dropdown * resize font on smaller screen * fix: different font for dropdown and input field * fix:styling of subheader calculator * add: scrollable margin value without showing scrollbar * fix: border radius and scientific annotation removal on swap calc * fix:different color in ios browser * fix:different color in ios browser * update: text area to flex * fix: dropdown label on tab change, error on mozilla, color on safari * fix: image for mobile version and remove some unused image & script * added special case for step index, range break 100,200 on margin calculation * fix: value and currency symbol alignment * refactor: major refactor * fix: image and formula * fix: backround on label input (active) and link on synthetic * fix: wrong text on swap-forex formula * fix: text content on swap-forex * fix: tab selector * fix: add color blues * fix: icons * fix: add alt on icons * fix:refactor codes Co-authored-by: sara-fs <[email protected]> Co-authored-by: sara-fs <[email protected]> Co-authored-by: Kevin <[email protected]> Co-authored-by: sean-binary <[email protected]> Co-authored-by: mustofa-binary <[email protected]> Co-authored-by: Mustofa Ghaleb Amami (Front End) <[email protected]> * Sean / fix: added KID notice (#1182) * fix: added KID notice * fix: added padding * Sean / Landing page for DP2P (#1173) * feat: [WIP]P2P landing page * fix: mobile responsiveness for P2P page * fix: navbar logo spacing for mobile * fix: background image positioning * fix: redirect links * fix: reduced image file sizes * fix: reducing media queries * Replaced mobile prop with show component * fix: button wording * fix: copyright svg color to white * revert last commit * fix: white copyright svg * fix: created v1 & v2 of DP2P page * fix: fixed console errors and paddings & margins * fix: button resizing * fix: redirect links and adding new span link text component * fix: blurry images and section margins * fix: hero font sizes and margins * fix: padding changes to reflect design * fix: issues regarding mobile paddings and margins * fix: issues with mobile design not matching * fix: added show component to handle mobile hero background * fix: redirect notice prompt * fix: mobile header center align * fix: redirecting before confirmation * fix: redirecting before confirmation for EU * fix: redirecting before confirmation for EU * fix: redirecting before confirmation for EU * fix: redirecting before confirmation for EU * fix: redirecting before confirmation for EU * fix: redirecting before confirmation for EU * revert back to 3adbc50 * replaced p2p_v1 prop to general nav_type prop Co-authored-by: Sean <[email protected]> * translate: extract upload * Sean / DP2P QR code (#1206) * feat: add QR code and desktop copywriting * moved p2p related assets into its own folder * translate: extract, upload * Matin/Add DP2P in Payment Method Page (#1204) * Matin/Add DP2P in Payment Method Page * Matin/Improvement: use Show component to separate Mobile and Desktop * Use pixel inside media queries * Matin/Fix/Improvement: Added mobileOsDetect * Fix dp2p buttons size and misalignments * Todo IOS os to redirect to apple store Co-authored-by: matin-binary <[email protected]> * translate: upload, extract dp2p payment method * fix: image alt * translate: download * translate: download chinese * translate: download fix zh cn and tw * translate: download pl * Sean/trading responsibly page not accessible (#1229) * fix: refactor using svgr syntax * Empty commit * fix: update svg * replace svg component with img element * Sean/dp2p page translatation ui (#1232) * fix: translation UI breaking * responsive button sizes for all languages * fix: translation UI breaking * fix: translation UI breaking * fix: translation UI breaking * fix: banner header size to cater all languages * translate: hotfix upload download * translate: download hotfix * feat: add p2p allowed country check for payment methods (#1239) Co-authored-by: mustofa-binary <[email protected]> * translate: download for calculator fix Co-authored-by: Kevin <[email protected]> Co-authored-by: sara-fs <[email protected]> Co-authored-by: sara-fs <[email protected]> Co-authored-by: Kevin <[email protected]> Co-authored-by: sean-binary <[email protected]> Co-authored-by: mustofa-binary <[email protected]> Co-authored-by: Sean <[email protected]> Co-authored-by: matin-binary <[email protected]> Co-authored-by: matin-binary <[email protected]>
1 parent eb21f7b commit 1552093

File tree

92 files changed

+6558
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+6558
-244
lines changed

crowdin/messages.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

gatsby-browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { WrapPagesWithLocaleContext } from './src/components/localization'
44
import { isProduction, isLocalHost } from './src/common/websocket/config'
55
import { CookieStorage, LocalStore } from './src/common/storage'
66
import TrafficSource from './src/common/traffic-source'
7-
import isMobile from './src/common/os-detect'
7+
import { isMobile } from './src/common/os-detect'
88
import { gtm_test_domain } from './src/common/utility'
99
import { MediaContextProvider } from './src/themes/media'
1010
import { DerivProvider } from './src/store'

src/common/country-base.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,40 @@ const eu_countries = [
3131
'mt',
3232
]
3333

34+
const p2p_allowed_countries = [
35+
'ng',
36+
'za',
37+
'zw',
38+
'tz',
39+
'gh',
40+
'zm',
41+
'bw',
42+
'na',
43+
'ke',
44+
'aq',
45+
'so',
46+
'pk',
47+
'in',
48+
'bd',
49+
'ik',
50+
'ci',
51+
'ar',
52+
'bo',
53+
'cl',
54+
'co',
55+
'ec',
56+
'gf',
57+
'gy',
58+
'py',
59+
'pe',
60+
'sr',
61+
'uy',
62+
've',
63+
]
64+
3465
export const isEuCountry = (clients_country) => eu_countries.includes(clients_country)
3566

67+
export const isP2PAllowedCountry = (clients_country) =>
68+
p2p_allowed_countries.includes(clients_country)
69+
3670
export const isUK = (clients_country) => clients_country === 'gb'

src/common/os-detect.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
const isMobile = () =>
1+
export const isMobile = () =>
22
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
33

4-
export default isMobile
4+
export const mobileOSDetect = () => {
5+
const userAgent = navigator.userAgent || navigator.vendor || window.opera
6+
7+
// Windows Phone must come first because its UA also contains "Android"
8+
if (/windows phone/i.test(userAgent)) {
9+
return 'Windows Phone'
10+
}
11+
12+
if (/android/i.test(userAgent)) {
13+
return 'Android'
14+
}
15+
16+
// iOS detection from: http://stackoverflow.com/a/9039885/177710
17+
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
18+
return 'iOS'
19+
}
20+
21+
return 'unknown'
22+
}

src/common/utility.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const trimSpaces = (value) => value.trim()
105105

106106
const deriv_app_url = 'https://app.deriv.com'
107107
const deriv_bot_app_url = 'https://app.deriv.com/bot'
108+
const deriv_dp2p_app_url = 'https://app.deriv.com/cashier/p2p'
108109
const smarttrader_url = 'https://smarttrader.deriv.com'
109110
const binary_url = 'https://binary.com'
110111
const deriv_cookie_domain = 'deriv.com'
@@ -115,6 +116,7 @@ const zoho_url = 'https://deriv.zohorecruit.com/'
115116
const brand_name = 'Deriv'
116117
const map_api_key = 'AIzaSyAEha6-HeZuI95L9JWmX3m6o-AxQr_oFqU'
117118
const gtm_test_domain = 'deriv-com.binary.sx'
119+
const p2p_playstore_url = 'https://play.google.com/store/apps/details?id=com.deriv.dp2p'
118120
const mga_link_url =
119121
'https://authorisation.mga.org.mt/verification.aspx?lang=EN&company=a5fd1edc-d072-4c26-b0cd-ab3fa0f0cc40&details=1'
120122

@@ -123,6 +125,8 @@ const dmt5_linux_url = 'https://www.metatrader5.com/en/terminal/help/start_advan
123125
const dmt5_android_url =
124126
'https://download.mql5.com/cdn/mobile/mt5/android?server=Deriv-Demo,Deriv-Server'
125127
const dmt5_ios_url = 'https://download.mql5.com/cdn/mobile/mt5/ios?server=Deriv-Demo,Deriv-Server'
128+
const dp2p_google_play_url =
129+
'https://play.google.com/store/apps/details?id=com.deriv.dp2p&hl=en&gl=US'
126130

127131
export {
128132
affiliate_signin_url,
@@ -136,6 +140,8 @@ export {
136140
community_url,
137141
deriv_app_url,
138142
deriv_bot_app_url,
143+
deriv_dp2p_app_url,
144+
dp2p_google_play_url,
139145
mga_link_url,
140146
debounce,
141147
brand_name,
@@ -162,4 +168,5 @@ export {
162168
toHashFormat,
163169
zoho_url,
164170
trimSpaces,
171+
p2p_playstore_url,
165172
}

src/components/custom/_dtrading.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const DTrading = ({ trading, reverse, two_title }) => {
126126
<ImageWrapper margin_right={!is_even ? '0' : '2.4rem'}>
127127
<QueryImage
128128
data={data[item.image_name]}
129-
alt={data[item.image_alt]}
129+
alt={item.image_alt}
130130
width="100%"
131131
/>
132132
</ImageWrapper>

src/components/elements/accordion.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ const AccordionWrapper = styled.div`
6565
const TRANSITION_DURATION = 250
6666

6767
// TODO: keyboard events and find a way to add proper focus handling
68-
const Accordion = ({ children, has_single_state, is_default_open }) => {
68+
const Accordion = ({ children, has_single_state, id, is_default_open }) => {
6969
const nodes = []
7070

7171
return has_single_state ? (
72-
<SingleAccordionContent is_default_open={is_default_open} nodes={nodes}>
72+
<SingleAccordionContent id={id} is_default_open={is_default_open} nodes={nodes}>
7373
{children}
7474
</SingleAccordionContent>
7575
) : (
@@ -79,11 +79,12 @@ const Accordion = ({ children, has_single_state, is_default_open }) => {
7979
Accordion.propTypes = {
8080
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
8181
has_single_state: PropTypes.bool,
82+
id: PropTypes.string,
8283
is_default_open: PropTypes.bool,
8384
nodes: PropTypes.array,
8485
}
8586

86-
const ItemExpanded = ({ is_default_open, child, child_idx, nodes }) => {
87+
const ItemExpanded = ({ is_default_open, child, child_idx, nodes, id }) => {
8788
const getHeight = (active_idx) => {
8889
return (
8990
nodes[active_idx] &&
@@ -95,7 +96,7 @@ const ItemExpanded = ({ is_default_open, child, child_idx, nodes }) => {
9596
// set height to auto to allow content that can resize inside the accordion
9697
// reset height to content height before collapse for transition (height: auto does not support transitions)
9798
if (is_expanded) setTimeout(() => setHeight('auto'), 200)
98-
else setTimeout(() => setHeight(0), 50)
99+
else setHeight(0)
99100
})
100101

101102
React.useEffect(() => {
@@ -110,6 +111,7 @@ const ItemExpanded = ({ is_default_open, child, child_idx, nodes }) => {
110111
<ResponsiveWrapper
111112
key={child_idx}
112113
style={child.props.parent_style}
114+
id={id}
113115
ref={(div) => {
114116
nodes[child_idx] = { ref: div }
115117
}}
@@ -168,11 +170,12 @@ const ItemExpanded = ({ is_default_open, child, child_idx, nodes }) => {
168170
ItemExpanded.propTypes = {
169171
child: PropTypes.any,
170172
child_idx: PropTypes.any,
173+
id: PropTypes.string,
171174
is_default_open: PropTypes.bool,
172175
nodes: PropTypes.any,
173176
}
174177

175-
const SingleAccordionContent = ({ is_default_open = false, nodes, children }) => {
178+
const SingleAccordionContent = ({ is_default_open = false, nodes, children, id }) => {
176179
const render_nodes = React.Children.map(children, (child, child_idx) => {
177180
return (
178181
<ItemExpanded
@@ -181,6 +184,7 @@ const SingleAccordionContent = ({ is_default_open = false, nodes, children }) =>
181184
child={child}
182185
child_idx={child_idx}
183186
nodes={nodes}
187+
id={id}
184188
/>
185189
)
186190
})
@@ -190,6 +194,7 @@ const SingleAccordionContent = ({ is_default_open = false, nodes, children }) =>
190194

191195
SingleAccordionContent.propTypes = {
192196
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
197+
id: PropTypes.string,
193198
is_default_open: PropTypes.bool,
194199
nodes: PropTypes.array,
195200
}
@@ -280,19 +285,21 @@ const AccordionContent = ({ children, nodes }) => {
280285
AccordionContent.propTypes = {
281286
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
282287
has_single_state: PropTypes.bool,
288+
id: PropTypes.string,
283289
nodes: PropTypes.array,
284290
}
285291

286-
const AccordionItem = ({ text, children, style }) => {
292+
const AccordionItem = ({ id, text, children, style }) => {
287293
return (
288-
<div style={style} header={text}>
294+
<div style={style} header={text} id={id}>
289295
{children}
290296
</div>
291297
)
292298
}
293299

294300
AccordionItem.propTypes = {
295301
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
302+
id: PropTypes.string,
296303
is_showed: PropTypes.bool,
297304
style: PropTypes.object,
298305
text: PropTypes.string,

src/components/elements/background-image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const StyledBackground = styled(BackgroundImage)`
1212
}
1313
`
1414

15-
const Background = ({ children, data, style, dark, ...props }) => {
15+
export const Background = ({ children, data, style, dark, ...props }) => {
1616
return (
1717
<StyledBackground
1818
Tag="div"

0 commit comments

Comments
 (0)