forked from binary-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request binary-com#40 from hamza-deriv/hamza/WALL-628/comp…
…are-account-card-with-description feat: description div added
- Loading branch information
Showing
23 changed files
with
648 additions
and
29 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
packages/cfd/src/Assets/svgs/trading-platform/ic-appstore-deriv-x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion
11
packages/cfd/src/Assets/svgs/trading-platform/ic-appstore-derived.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
packages/cfd/src/Assets/svgs/trading-platform/ic-appstore-financial.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
25 changes: 25 additions & 0 deletions
25
packages/cfd/src/Containers/cfd-compare-accounts/cfd-compare-accounts-card.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,25 @@ | ||
import React from 'react'; | ||
import { TModifiedTradingPlatformAvailableAccount } from 'Components/props.types'; | ||
import CFDInstrumentsLabelHighlighted from './cfd-instruments-label-highlighted'; | ||
import CFDCompareAccountsDescription from './cfd-compare-accounts-description'; | ||
import CFDCompareAccountsTitleIcon from './cfd-compare-accounts-title-icon'; | ||
import CFDCompareAccountsPlatformLabel from './cfd-compare-accounts-platform-label'; | ||
|
||
type TCFDCompareAccountsCardProps = { | ||
trading_platforms: TModifiedTradingPlatformAvailableAccount; | ||
}; | ||
|
||
const CFDCompareAccountsCard = ({ trading_platforms }: TCFDCompareAccountsCardProps) => { | ||
return ( | ||
<div className='compare-cfd-account-main-container'> | ||
<CFDCompareAccountsPlatformLabel trading_platforms={trading_platforms} /> | ||
<div className='compare-cfd-account-card-container'> | ||
<CFDCompareAccountsTitleIcon trading_platforms={trading_platforms} /> | ||
<CFDCompareAccountsDescription trading_platforms={trading_platforms} /> | ||
<CFDInstrumentsLabelHighlighted trading_platforms={trading_platforms} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CFDCompareAccountsCard; |
60 changes: 60 additions & 0 deletions
60
packages/cfd/src/Containers/cfd-compare-accounts/cfd-compare-accounts-description.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,60 @@ | ||
import React from 'react'; | ||
import { Text } from '@deriv/components'; | ||
import { TModifiedTradingPlatformAvailableAccount } from 'Components/props.types'; | ||
import { getJuridisctionDescription, getMarketType } from '../../Helpers/compare-accounts-config'; | ||
|
||
type TCFDCompareAccountsDescriptionProps = { | ||
trading_platforms: TModifiedTradingPlatformAvailableAccount; | ||
}; | ||
|
||
const CFDCompareAccountsDescription = ({ trading_platforms }: TCFDCompareAccountsDescriptionProps) => { | ||
const market_type = getMarketType(trading_platforms); | ||
const jurisdiction_shortcode = market_type.concat('_', trading_platforms.shortcode); | ||
const juridisction_data = getJuridisctionDescription(jurisdiction_shortcode); | ||
return ( | ||
<div className={'compare-cfd-account-text-container'}> | ||
<div className='compare-cfd-account-text-container__separator'> | ||
<Text as='h1' weight='bold' size='m' align='center'> | ||
{juridisction_data.leverage} | ||
</Text> | ||
<Text as='p' size='xxxs' align='center'> | ||
{juridisction_data.leverage_description} | ||
</Text> | ||
</div> | ||
<div className='compare-cfd-account-text-container__separator'> | ||
<Text as='h1' weight='bold' size='m' align='center'> | ||
{juridisction_data.spread} | ||
</Text> | ||
<Text as='p' size='xxxs' align='center'> | ||
{juridisction_data.spread_description} | ||
</Text> | ||
</div> | ||
<div className='compare-cfd-account-text-container__separator'> | ||
<Text as='h1' weight='bold' size='xxs' align='center'> | ||
{juridisction_data.counterparty_company} | ||
</Text> | ||
<Text as='p' size='xxxs' align='center'> | ||
{juridisction_data.counterparty_company_description} | ||
</Text> | ||
</div> | ||
<div className='compare-cfd-account-text-container__separator'> | ||
<Text as='h1' weight='bold' size='xxs' align='center'> | ||
{juridisction_data.jurisdiction} | ||
</Text> | ||
<Text as='p' size='xxxs' align='center'> | ||
{juridisction_data.jurisdiction_description} | ||
</Text> | ||
</div> | ||
<div className='compare-cfd-account-text-container__separator'> | ||
<Text as='h1' weight='bold' size='xxs' align='center'> | ||
{juridisction_data.regulator} | ||
</Text> | ||
<Text as='p' size='xxxs' align='center'> | ||
{juridisction_data.regulator_description} | ||
</Text> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CFDCompareAccountsDescription; |
28 changes: 28 additions & 0 deletions
28
packages/cfd/src/Containers/cfd-compare-accounts/cfd-compare-accounts-platform-label.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,28 @@ | ||
import React from 'react'; | ||
import { Text } from '@deriv/components'; | ||
import classNames from 'classnames'; | ||
import { TModifiedTradingPlatformAvailableAccount } from 'Components/props.types'; | ||
import { getPlatformLabel, getHeaderColor, platfromsHeaderLabel } from '../../Helpers/compare-accounts-config'; | ||
|
||
type TCFDCompareAccountsPlatformLabelProps = { | ||
trading_platforms: TModifiedTradingPlatformAvailableAccount; | ||
}; | ||
|
||
const CFDCompareAccountsPlatformLabel = ({ trading_platforms }: TCFDCompareAccountsPlatformLabelProps) => { | ||
const platform_label = getPlatformLabel(trading_platforms.platform || ''); | ||
const header_color = getHeaderColor(platform_label); | ||
|
||
return ( | ||
<div | ||
className={classNames('compare-cfd-account-platform-label', { | ||
'compare-cfd-account-platform-label--other-cfds': platform_label === platfromsHeaderLabel.other_cfds, | ||
})} | ||
> | ||
<Text as='p' weight='bold' size='xxxs' align='center' color={header_color}> | ||
{platform_label} | ||
</Text> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CFDCompareAccountsPlatformLabel; |
36 changes: 36 additions & 0 deletions
36
packages/cfd/src/Containers/cfd-compare-accounts/cfd-compare-accounts-title-icon.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,36 @@ | ||
import React from 'react'; | ||
import { Text } from '@deriv/components'; | ||
import TradigPlatformIconProps from '../../Assets/svgs/trading-platform'; | ||
import { TModifiedTradingPlatformAvailableAccount } from 'Components/props.types'; | ||
import { getAccountCardTitle, getMarketType, getAccountIcon } from '../../Helpers/compare-accounts-config'; | ||
|
||
type TCFDCompareAccountsTitleIconProps = { | ||
trading_platforms: TModifiedTradingPlatformAvailableAccount; | ||
}; | ||
|
||
const CFDCompareAccountsTitleIcon = ({ trading_platforms }: TCFDCompareAccountsTitleIconProps) => { | ||
const market_type = getMarketType(trading_platforms); | ||
const jurisdiction_shortcode = market_type.concat('_', trading_platforms.shortcode); | ||
const jurisdiction_card_icon = | ||
trading_platforms.platform === 'dxtrade' | ||
? getAccountIcon(trading_platforms.platform) | ||
: getAccountIcon(market_type); | ||
const jurisdiction_card_title = | ||
trading_platforms.platform === 'dxtrade' | ||
? getAccountCardTitle(trading_platforms.platform) | ||
: getAccountCardTitle(jurisdiction_shortcode); | ||
|
||
return ( | ||
<React.Fragment> | ||
<div className={'compare-cfd-account-icon-title'}> | ||
<TradigPlatformIconProps icon={jurisdiction_card_icon} size={48} /> | ||
<Text as='h1' weight='bold' size='xs' align='center'> | ||
{jurisdiction_card_title} | ||
</Text> | ||
</div> | ||
<hr className='compare-cfd-account-underline' /> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default CFDCompareAccountsTitleIcon; |
Oops, something went wrong.