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.

Mohammad/ Update assets information #2680

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
7f49b9a
apply all changes according to Asset gaps pdf. only icons remained.
Jan 20, 2022
52dac91
add: all svg icons and update accoring files
Jan 21, 2022
5b50368
update eu changes
Jan 21, 2022
4779186
update: uk assets information
Jan 21, 2022
8fa4585
add UKEU component to visibility
Jan 21, 2022
f684ceb
minify svgs
Jan 21, 2022
9ebd32d
fix: UK version problems
Jan 21, 2022
a49393a
Merge branch 'master' into update-assets-information
mohammad-hashemi-deriv Jan 21, 2022
bc7466d
fix: few bugs on EU version
Jan 21, 2022
1745bce
Merge branch 'update-assets-information' of https://github.com/mohamm…
Jan 21, 2022
579a0df
fix: remove cryptocurrency tab in uk market
Jan 21, 2022
ae1790a
update symbols and add EU crypto items
Jan 21, 2022
7018b3d
fix nzd-cad icon and remove micro-pairs from UK
Jan 21, 2022
0dff539
remove commodities options from UK
Jan 21, 2022
a444b8c
add forex to noneu and nonuk
Jan 21, 2022
a860a79
separate cfds minor pairs from options minor pairs
Jan 24, 2022
3721e6b
remove synthetic and crypto from uk
Jan 24, 2022
2bfe184
remove synthetic indices and cryptocurrency from off-convas-menu and …
Jan 24, 2022
66d9a5e
merge eu uk forex cfds since the are the same
Jan 24, 2022
2d1dd18
add crypto-pairs icons to svg foler
Jan 25, 2022
253ba4b
add import and export for all added crypto pairs icons in symbols.js
Jan 25, 2022
cc46a3b
add all crypto pairs icons to the site
Jan 25, 2022
bab9393
minify all crypto pair svgs
Jan 25, 2022
41c1f40
add ava-usd and ter-usd to cryptocurrency
Jan 25, 2022
9eb1a27
remove crypto and synthetic from footer and other-markets in uk version
Jan 25, 2022
8fdee86
rearrange all market names alphabetically
Jan 25, 2022
d4008bd
rename cryptocurrency to crypto pairs in cfd trading
Jan 25, 2022
633e143
remove synthetic indices from trade-types-multiplier page in uk version
Jan 26, 2022
e65ca03
remove duplicate cad-chf from forex minor pairs and replace chf-jpy
Jan 26, 2022
b0ad8e5
add uk_markets array to othermarkets
Jan 26, 2022
1035176
remove navigate-replace from crypto and synthetic page in uk version
Jan 26, 2022
f55d37c
cleaner map in _energy.js and use desktop and mobile component instea…
Jan 27, 2022
538e207
fix conflicts
Jan 27, 2022
b0f1d00
minify svgs
Jan 27, 2022
b39523e
fix: space between other markets cards in UK version
Jan 27, 2022
bd9b91d
refactor: resolve conflicts
Jan 30, 2022
c51ebc3
resolve merge conflicts with master
Feb 8, 2022
37fc10d
fix: unresovled conflicts which didn't allow project to run
Feb 8, 2022
ce30b25
revert: remove image-not-available.png
Feb 8, 2022
9afb913
fix: update assets description
Feb 9, 2022
7661f4e
fix: incorrect asset added to Options synthetic indices.
Feb 9, 2022
06d0680
fix: duplicate instruments on row forex page
Feb 9, 2022
79207d7
fix: empty energy list in comodities
Feb 9, 2022
2256467
fix: add 300 ticks to crash boom row description
Feb 9, 2022
704071b
fix: in uk remove synthetic indices from description
Feb 10, 2022
fd7d42d
fix: remove synthetic indices from trade-types page available markets
Feb 10, 2022
ed6ee83
fix: remove duplicate 'and' words
Feb 10, 2022
28e0988
fix: replace germany 30 by germany 40 in description
Feb 10, 2022
dc0a84e
fix: remove everything according to germany 30
Feb 10, 2022
22c2748
fix: remove synthetic indices and crypto from uk available markets
Feb 11, 2022
4034207
refactor: hardcoded available markets component to dynamic components
Feb 11, 2022
059e4b1
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
Feb 11, 2022
b063185
fix: other carousel issues after previous changes
Feb 14, 2022
664fa6e
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
Feb 14, 2022
9112941
trigger vercel
Feb 14, 2022
7c86b53
remove cr crash-boom 300
Feb 14, 2022
dd72cf8
feat: remove jump indices from eu and add metals for eu
Feb 14, 2022
35ead14
remove oil/usd from cr
Feb 15, 2022
f854a6b
style: add 2px x-padding for volatility indices
Feb 15, 2022
800c8d4
fix: markets tab scroll offset in mobile uk
Feb 16, 2022
15decfa
fix: add crash boom 300 to cr
Feb 16, 2022
83af523
fix: bring back oil/usd to energy cr
Feb 16, 2022
c164ab2
fix: remove crash boom from multipliers taab
Feb 17, 2022
1bbbce9
fix: energy under cfds tab and options tab are different now
Feb 17, 2022
2faa429
feat: add xalusd xcuusd xniusd xpbusd xznusd to metals
Feb 17, 2022
71d6155
fix: zinc typo
Feb 17, 2022
b3fa308
fix: remove 5 metals from options
Feb 17, 2022
9b14647
fix: update crash/boom
Feb 18, 2022
31b708a
fix: now metal cfds are the same in all regions
Feb 18, 2022
3f35f33
fix: volatility 200, 300 icon in eu region
Feb 18, 2022
0f0e146
fix: trade-types multiplier crash boom description in cr
Feb 18, 2022
ff37ab8
fix: typo in crash boom description
Feb 18, 2022
6a485ca
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
Feb 18, 2022
d8f50b9
fix: update crash boom 300 icon and remove old icons from src
Feb 18, 2022
f62706f
fix: remove 200s 300s from countinous indices description
Feb 21, 2022
77d3cf4
chore: add crash boom 300 to CR
Feb 21, 2022
761df20
fix: crash boom in cfds is now different than multipliers
Feb 21, 2022
e763aef
fix: remove crash boom 300 from trade-types/multiplier page
Feb 21, 2022
bc5577c
fix: crash boom in eu trader tools shows 300 now
Feb 22, 2022
c750ae0
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
Feb 22, 2022
0325736
fix: rename airbnb to airbnb inc
Feb 22, 2022
89ed23e
chore: update graphql.types.ts
Feb 22, 2022
5f86d19
fix: update other stock names
Feb 22, 2022
a8727f0
fix: stocks order by alphabet
Feb 22, 2022
a8bbdad
chore: refactor to use the latest features of visibility.tsx
Feb 22, 2022
7c1933d
chore: remove package-lock.json
Feb 23, 2022
36b3101
Merge branch 'master' of https://github.com/binary-com/deriv-com into…
Feb 23, 2022
b49205d
chore: replace new package-lock.json
Feb 23, 2022
49b711a
chore: replace the original package-lock.json from deriv-com/master
Feb 23, 2022
1a11762
chore: update graphql.types
Feb 23, 2022
cb3b4dd
chore: update graphql.types again
Feb 23, 2022
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
3 changes: 3 additions & 0 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const getDomainAppID = () => {
else return deriv_com_app_id
}

export const eu_domains = ['eu', 'staging-eu']
export const uk_domains = ['uk', 'staging-uk']

// URL
export const domain_full_url = `https://${getDomainUrl()}`
export const deriv_app_id = getDomainAppID()
Expand Down
3 changes: 2 additions & 1 deletion src/components/containers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CssGrid, { CssGridColumn } from './css-grid'
import SEO from './seo'
import Show from './show'
import Box from './box'
import { Desktop, Mobile, EU, UK, ROW, NonEU, NonUK } from './visibility'
import { Desktop, Mobile, EU, UK, ROW, NonEU, NonUK, UKEU } from './visibility'

export {
Container,
Expand All @@ -26,6 +26,7 @@ export {
Mobile,
EU,
UK,
UKEU,
ROW,
NonUK,
NonEU,
Expand Down
63 changes: 35 additions & 28 deletions src/components/containers/visibility.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { ReactElement, useEffect, useState } from 'react'
import React, { ReactElement, useEffect, useState, useContext } from 'react'
import styled from 'styled-components'
import { size } from 'themes/device'
import { useBrowserResize } from 'components/hooks/use-browser-resize'
import { DerivStore } from 'store'
import { eu_domains, uk_domains } from 'common/constants'

type ResponsiveContainerProps = {
children: ReactElement
Expand All @@ -26,6 +27,7 @@ const DesktopLayer = styled.div<LayerProps>`
display: none;
}
`

const MobileLayer = styled.div<LayerProps>`
@media (min-width: ${({ breakpoint }) => breakpoint}px) {
display: none;
Expand All @@ -38,11 +40,12 @@ const domainBasedCheck = () => {

useEffect(() => {
if (window) {
const host_name = window.location.hostname
if (host_name.includes('eu')) {
const subdomain = window.location.hostname.split('.').slice(0, -2).join('.')

if (eu_domains.includes(subdomain)) {
setEuDomain(true)
}
if (host_name.includes('uk')) {
if (uk_domains.includes(subdomain)) {
setUkDomain(true)
}
}
Expand All @@ -65,6 +68,20 @@ const deviceRenderer = (): boolean => {
return is_loaded
}

export const getCountryRule = () => {
const { is_eu_domain, is_uk_domain } = domainBasedCheck()
const { is_eu_country, is_uk_country } = useContext<StoreDataType>(DerivStore)

const is_eu = (is_eu_country || is_eu_domain) && !is_uk_country
const is_uk = is_uk_country || is_uk_domain
const is_non_uk = !is_uk
const is_non_eu = !is_eu
const is_eu_uk = !(!is_eu && !is_uk)
const is_row = !is_eu_uk

return { is_eu, is_uk, is_non_uk, is_non_eu, is_eu_uk, is_row }
}

export const Desktop = ({
children,
breakpoint = DEFAULT_BREAKPOINT,
Expand All @@ -74,7 +91,7 @@ export const Desktop = ({
const [is_mobile] = useBrowserResize(breakpoint_size)
const is_loaded = deviceRenderer()

const desktop_view = is_mobile ? <></> : <div className={className}>{children}</div>
const desktop_view = is_mobile ? <></> : <>{children}</>

return is_loaded ? (
desktop_view
Expand Down Expand Up @@ -102,47 +119,37 @@ export const Mobile = ({
}

export const EU = ({ children }: ResponsiveContainerProps) => {
const { is_eu_domain } = domainBasedCheck()
const { is_eu_country } = React.useContext<StoreDataType>(DerivStore)

const is_eu = is_eu_country || is_eu_domain
const { is_eu } = getCountryRule()

return is_eu ? <>{children}</> : null
}

export const NonEU = ({ children }: ResponsiveContainerProps) => {
const { is_eu_domain } = domainBasedCheck()
const { is_eu_country } = React.useContext<StoreDataType>(DerivStore)
const { is_non_eu } = getCountryRule()

const is_eu = is_eu_domain || is_eu_country

return !is_eu ? <>{children}</> : null
return is_non_eu ? <>{children}</> : null
}

export const UK = ({ children }: ResponsiveContainerProps) => {
const { is_uk_domain } = domainBasedCheck()
const { is_uk_country } = React.useContext<StoreDataType>(DerivStore)

const is_uk = is_uk_country || is_uk_domain
const { is_uk } = getCountryRule()

return is_uk ? <>{children}</> : null
}

export const NonUK = ({ children }: ResponsiveContainerProps) => {
const { is_uk_domain } = domainBasedCheck()
const { is_uk_country } = React.useContext<StoreDataType>(DerivStore)
const { is_non_uk } = getCountryRule()

const is_uk = is_uk_domain || is_uk_country
return is_non_uk ? <>{children}</> : null
}

return !is_uk ? <>{children}</> : null
export const UKEU = ({ children }: ResponsiveContainerProps) => {
const { is_eu_uk } = getCountryRule()

return is_eu_uk ? <>{children}</> : null
}

export const ROW = ({ children }: ResponsiveContainerProps) => {
const { is_uk_domain, is_eu_domain } = domainBasedCheck()
const { is_uk_country, is_eu_country } = React.useContext<StoreDataType>(DerivStore)

const is_uk = is_uk_country || is_uk_domain
const is_eu = is_eu_domain || is_eu_country
const { is_row } = getCountryRule()

return !is_eu && !is_uk ? <>{children}</> : null
return is_row ? <>{children}</> : null
}
123 changes: 65 additions & 58 deletions src/components/custom/other-platforms.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import styled, { css } from 'styled-components'
import { SectionContainer, Flex, FlexGridContainer, EU, NonEU } from 'components/containers'
import { SectionContainer, Flex, FlexGridContainer, EU, NonEU, ROW } from 'components/containers'
import {
Text,
Card,
Expand All @@ -12,6 +12,7 @@ import {
Divider,
} from 'components/elements'
import { localize, LocalizedLink, Localize } from 'components/localization'
import { getCountryRule } from 'components/containers/visibility'
import { binary_bot_url } from 'common/constants'
import device from 'themes/device'
// icons
Expand Down Expand Up @@ -286,7 +287,7 @@ export const NavPlatform = ({ onClick, is_ppc, is_ppc_redirect }) => {
onClick={onClick}
to="/trade-types/cfds/"
/>
<NonEU>
<ROW>
<NavCard
aria_label="Options"
icon={() => <img src={Options} alt="" width="32" height="32" />}
Expand All @@ -297,7 +298,7 @@ export const NavPlatform = ({ onClick, is_ppc, is_ppc_redirect }) => {
onClick={onClick}
to="/trade-types/options/"
/>
</NonEU>
</ROW>
<NavCard
aria_label="Multipliers"
icon={() => <img src={Multipliers} alt="" width="32" height="32" />}
Expand All @@ -324,7 +325,7 @@ export const NavPlatform = ({ onClick, is_ppc, is_ppc_redirect }) => {
onClick={onClick}
to={is_ppc_redirect ? '/landing/dmt5/' : '/dmt5/'}
/>
<NonEU>
<ROW>
<>
<NavCard
aria_label="Derivx"
Expand All @@ -351,7 +352,7 @@ export const NavPlatform = ({ onClick, is_ppc, is_ppc_redirect }) => {
otherLinkProps={{ rel: 'noopener noreferrer' }}
/>
</>
</NonEU>
</ROW>
</Flex>
<Flex direction="column" wrap="wrap" jc="flex-start">
<EmptySpace />
Expand All @@ -365,7 +366,7 @@ export const NavPlatform = ({ onClick, is_ppc, is_ppc_redirect }) => {
onClick={onClick}
to="/dtrader/"
/>
<NonEU>
<ROW>
<>
<NavCard
aria_label="Deriv GO"
Expand Down Expand Up @@ -401,7 +402,7 @@ export const NavPlatform = ({ onClick, is_ppc, is_ppc_redirect }) => {
otherLinkProps={{ rel: 'noopener noreferrer' }}
/>
</>
</NonEU>
</ROW>
</Flex>
</Flex>
)
Expand All @@ -413,62 +414,68 @@ NavPlatform.propTypes = {
onClick: PropTypes.func,
}

export const NavMarket = ({ onClick, is_ppc }) => (
<Flex direction="column" wrap="wrap" jc="flex-start">
<NavCard
aria_label="Forex"
icon={() => <img src={Forex} alt="" width="32" height="32" />}
content={
<Localize translate_text="Trade the world’s largest financial market with popular forex pairs." />
}
title={<Localize translate_text="Forex" />}
onClick={onClick}
to="/markets/forex/"
/>
{!is_ppc && (
export const NavMarket = ({ onClick, is_ppc }) => {
const { is_not_uk } = getCountryRule()

return (
<Flex direction="column" wrap="wrap" jc="flex-start">
<NavCard
aria_label="Synthetic indices"
icon={() => <img src={SyntheticIndices} alt="" width="32" height="32" />}
aria_label="Forex"
icon={() => <img src={Forex} alt="" width="32" height="32" />}
content={
<Localize translate_text="Enjoy synthetic markets that emulate real-world market movements." />
<Localize translate_text="Trade the world’s largest financial market with popular forex pairs." />
}
title={<Localize translate_text="Synthetic indices" />}
title={<Localize translate_text="Forex" />}
onClick={onClick}
to="/markets/synthetic/"
to="/markets/forex/"
/>
)}
<NavCard
aria_label="Stocks & indices"
icon={() => <img src={StockIndices} alt="" width="32" height="32" />}
content={
<Localize translate_text="Predict broader market trends and diversify your risk with stocks & indices." />
}
title={<Localize translate_text="Stocks & indices" />}
onClick={onClick}
to="/markets/stock/"
/>
<NavCard
aria_label="Cryptocurrencies"
icon={() => <img src={Cryptocurrencies} alt="" width="32" height="32" />}
content={
<Localize translate_text="Trade with leverage on the price movement of popular crypto-fiat pairs." />
}
title={<Localize translate_text="Cryptocurrencies" />}
onClick={onClick}
to="/markets/cryptocurrencies/"
/>
<NavCard
aria_label="Commodities"
icon={() => <img src={Commodities} alt="" width="32" height="32" />}
content={
<Localize translate_text="Trade natural resources that are central to the world's economy." />
}
title={<Localize translate_text="Commodities" />}
onClick={onClick}
to="/markets/commodities/"
/>
</Flex>
)
{!is_ppc && is_not_uk && (
<NavCard
aria_label="Synthetic indices"
icon={() => <img src={SyntheticIndices} alt="" width="32" height="32" />}
content={
<Localize translate_text="Enjoy synthetic markets that emulate real-world market movements." />
}
title={<Localize translate_text="Synthetic indices" />}
onClick={onClick}
to="/markets/synthetic/"
/>
)}
<NavCard
aria_label="Stocks & indices"
icon={() => <img src={StockIndices} alt="" width="32" height="32" />}
content={
<Localize translate_text="Predict broader market trends and diversify your risk with stocks & indices." />
}
title={<Localize translate_text="Stocks & indices" />}
onClick={onClick}
to="/markets/stock/"
/>
{is_not_uk && (
<NavCard
aria_label="Cryptocurrencies"
icon={() => <img src={Cryptocurrencies} alt="" width="32" height="32" />}
content={
<Localize translate_text="Trade with leverage on the price movement of popular crypto-fiat pairs." />
}
title={<Localize translate_text="Cryptocurrencies" />}
onClick={onClick}
to="/markets/cryptocurrencies/"
/>
)}
<NavCard
aria_label="Commodities"
icon={() => <img src={Commodities} alt="" width="32" height="32" />}
content={
<Localize translate_text="Trade natural resources that are central to the world's economy." />
}
title={<Localize translate_text="Commodities" />}
onClick={onClick}
to="/markets/commodities/"
/>
</Flex>
)
}

NavMarket.propTypes = {
is_ppc: PropTypes.bool,
Expand Down
1 change: 0 additions & 1 deletion src/components/elements/carousel/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export const Carousel = ({
chevron_style || {}
const is_arrow = prevBtnEnabled || nextBtnEnabled
const { nav_color, bottom_offset, height } = navigation_style || {}

return (
<div style={container_style}>
<Embla>
Expand Down
Loading