-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thisyahlen/feat: cfd created accounts list (#10126)
* chore: refactor tradingaccountcard * chore: handle created derivx account * chore: update style in dxtrade * chore: show ctrader to only virtual wallet and remove derivez from ui * chore: fix dxtrade length
- Loading branch information
1 parent
32bc244
commit e87c7de
Showing
13 changed files
with
284 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
packages/wallets/src/components/AddedDxtradeAccountsList/AddedDxtradeAccountsList.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
.wallets-available-derivx { | ||
&__transfer_button { | ||
display: flex; | ||
height: 32px; | ||
padding: 6px 16px; | ||
justify-content: center; | ||
align-items: center; | ||
border-radius: 4px; | ||
border: 1px solid var(--system-light-3-less-prominent-text, #999); | ||
cursor: pointer; | ||
background: #fff; | ||
} | ||
|
||
&__transfer_text { | ||
color: var(--system-light-1-prominent-text, #333); | ||
text-align: center; | ||
|
||
/* desktop/paragraph/P2 - bold */ | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 20px; /* 142.857% */ | ||
} | ||
|
||
&__open_text { | ||
color: var(--system-dark-1-prominent-text, #fff); | ||
text-align: center; | ||
|
||
/* desktop/paragraph/P2 - bold */ | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 20px; /* 142.857% */ | ||
} | ||
|
||
&__actions { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 4px; | ||
} | ||
|
||
&__details { | ||
flex-grow: 1; | ||
|
||
&-loginid { | ||
color: var(--system-light-3-less-prominent-text, #999); | ||
|
||
/* desktop/small/S - bold */ | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 12px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 18px; /* 150% */ | ||
} | ||
|
||
&-title { | ||
color: var(--system-light-2-general-text, #333); | ||
|
||
/* desktop/paragraph/P2 - bold */ | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 20px; /* 142.857% */ | ||
} | ||
|
||
&-balance { | ||
color: var(--system-light-1-prominent-text, #333); | ||
|
||
/* desktop/paragraph/P2 - bold */ | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 20px; /* 142.857% */ | ||
} | ||
|
||
&-description { | ||
font-size: 1.2rem; | ||
line-height: 14px; | ||
|
||
@include mobile { | ||
font-size: 1.4rem; | ||
line-height: 20px; | ||
} | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
packages/wallets/src/components/AddedDxtradeAccountsList/AddedDxtradeAccountsList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react'; | ||
import { useDxtradeAccountsList } from '@deriv/api'; | ||
import DerivX from '../../public/images/derivx.svg'; | ||
import { PrimaryActionButton } from '../PrimaryActionButton'; | ||
import { TradingAccountCard } from '../TradingAccountCard'; | ||
import './AddedDxtradeAccountsList.scss'; | ||
|
||
const AddedDxtradeAccountsList: React.FC = () => { | ||
const { data } = useDxtradeAccountsList(); | ||
|
||
return ( | ||
<TradingAccountCard | ||
leading={() => ( | ||
<div className='wallets-available-derivx__icon'> | ||
<DerivX /> | ||
</div> | ||
)} | ||
trailing={() => ( | ||
<div className='wallets-available-derivx__actions'> | ||
<PrimaryActionButton className='wallets-available-derivx__transfer_button'> | ||
<p className='wallets-available-derivx__transfer_text'>Transfer</p> | ||
</PrimaryActionButton> | ||
<PrimaryActionButton> | ||
<p className='wallets-available-derivx__open_text'>Open</p> | ||
</PrimaryActionButton> | ||
</div> | ||
)} | ||
> | ||
<div className='wallets-available-derivx__details'> | ||
{data?.map(account => ( | ||
<> | ||
<p className='wallets-available-derivx__details-title'>Deriv X</p> | ||
<p className='wallets-available-derivx__details-balance'> | ||
{account?.display_balance} {account?.currency} | ||
</p> | ||
<p className='wallets-available-derivx__details-loginid'>{account.login}</p> | ||
</> | ||
))} | ||
</div> | ||
</TradingAccountCard> | ||
); | ||
}; | ||
|
||
export default AddedDxtradeAccountsList; |
1 change: 1 addition & 0 deletions
1
packages/wallets/src/components/AddedDxtradeAccountsList/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as AddedDxtradeAccountsList } from './AddedDxtradeAccountsList'; |
32 changes: 32 additions & 0 deletions
32
...ges/wallets/src/components/AvailableDerivezAccountsList/AvailableDerivezAccountsList.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.wallets-available-derivez { | ||
&__text { | ||
color: var(--brand-coral, #ff444f); | ||
text-align: center; | ||
|
||
/* desktop/paragraph/P2 - bold */ | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 20px; /* 142.857% */ | ||
} | ||
|
||
&__details { | ||
flex-grow: 1; | ||
&-title { | ||
font-weight: bold; | ||
font-size: 1.4rem; | ||
line-height: 20px; | ||
} | ||
|
||
&-description { | ||
font-size: 1.2rem; | ||
line-height: 14px; | ||
|
||
@include mobile { | ||
font-size: 1.4rem; | ||
line-height: 20px; | ||
} | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...ages/wallets/src/components/AvailableDerivezAccountsList/AvailableDerivezAccountsList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import DerivEZ from '../../public/images/derivez.svg'; | ||
import { SecondaryActionButton } from '../SecondaryActionButton'; | ||
import { TradingAccountCard } from '../TradingAccountCard'; | ||
import './AvailableDerivezAccountsList.scss'; | ||
|
||
const AvailableDerivezAccountsList: React.FC = () => { | ||
return ( | ||
<TradingAccountCard | ||
leading={() => ( | ||
<div className='wallets-available-derivez__icon'> | ||
<DerivEZ /> | ||
</div> | ||
)} | ||
trailing={() => ( | ||
<SecondaryActionButton> | ||
<p className='wallets-available-derivez__text'>Get</p> | ||
</SecondaryActionButton> | ||
)} | ||
> | ||
<div className='wallets-available-derivez__details'> | ||
<p className='wallets-available-derivez__details-title'>Deriv EZ</p> | ||
<p className='wallets-available-derivez__details-description'> | ||
This account offers CFDs on an easy-to-get-started CFD trading platform. | ||
</p> | ||
</div> | ||
</TradingAccountCard> | ||
); | ||
}; | ||
|
||
export default AvailableDerivezAccountsList; |
1 change: 1 addition & 0 deletions
1
packages/wallets/src/components/AvailableDerivezAccountsList/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as AvailableDerivezAccountsList } from './AvailableDerivezAccountsList'; |
32 changes: 32 additions & 0 deletions
32
...ges/wallets/src/components/AvailableDxtradeAccountsList/AvailableDxtradeAccountsList.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.wallets-available-dxtrade { | ||
&__text { | ||
color: var(--brand-coral, #ff444f); | ||
text-align: center; | ||
|
||
/* desktop/paragraph/P2 - bold */ | ||
font-family: 'IBM Plex Sans'; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 20px; /* 142.857% */ | ||
} | ||
|
||
&__details { | ||
flex-grow: 1; | ||
&-title { | ||
font-weight: bold; | ||
font-size: 1.4rem; | ||
line-height: 20px; | ||
} | ||
|
||
&-description { | ||
font-size: 1.2rem; | ||
line-height: 14px; | ||
|
||
@include mobile { | ||
font-size: 1.4rem; | ||
line-height: 20px; | ||
} | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...ages/wallets/src/components/AvailableDxtradeAccountsList/AvailableDxtradeAccountsList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import DerivX from '../../public/images/derivx.svg'; | ||
import { SecondaryActionButton } from '../SecondaryActionButton'; | ||
import { TradingAccountCard } from '../TradingAccountCard'; | ||
import './AvailableDxtradeAccountsList.scss'; | ||
|
||
const AvailableDxtradeAccountsList: React.FC = () => { | ||
return ( | ||
<TradingAccountCard | ||
leading={() => ( | ||
<div className='wallets-available-dxtrade__icon'> | ||
<DerivX /> | ||
</div> | ||
)} | ||
trailing={() => ( | ||
<SecondaryActionButton> | ||
<p className='wallets-available-dxtrade__text'>Get</p> | ||
</SecondaryActionButton> | ||
)} | ||
> | ||
<div className='wallets-available-dxtrade__details'> | ||
<p className='wallets-available-dxtrade__details-title'>Deriv X</p> | ||
<p className='wallets-available-dxtrade__details-description'> | ||
This account offers CFDs on a highly customisable CFD trading platform. | ||
</p> | ||
</div> | ||
</TradingAccountCard> | ||
); | ||
}; | ||
|
||
export default AvailableDxtradeAccountsList; |
1 change: 1 addition & 0 deletions
1
packages/wallets/src/components/AvailableDxtradeAccountsList/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as AvailableDxtradeAccountsList } from './AvailableDxtradeAccountsList'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 7 additions & 34 deletions
41
packages/wallets/src/components/OtherCFDPlatformsList/OtherCFDPlatformsList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e87c7de
There was a problem hiding this comment.
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-app – ./
binary.sx
deriv-app-git-master.binary.sx
deriv-app.vercel.app
deriv-app.binary.sx