-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sell-p3): load swap accounts to sell
- Loading branch information
Philip London
committed
Nov 17, 2020
1 parent
7e165a4
commit 9baec20
Showing
4 changed files
with
92 additions
and
63 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
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
64 changes: 64 additions & 0 deletions
64
...blockchain-wallet-v4-frontend/src/modals/Swap/CoinSelection/CryptoAccountOption/index.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,64 @@ | ||
import React from 'react' | ||
|
||
import { | ||
BalanceRow, | ||
CircleBorder, | ||
FlexStartRow, | ||
Option, | ||
OptionTitle, | ||
OptionValue | ||
} from '../../components' | ||
import { FiatType, SupportedWalletCurrenciesType } from 'core/types' | ||
import { Icon } from 'blockchain-info-components' | ||
import { SuccessCartridge } from 'components/Cartridge' | ||
import { SwapAccountType } from 'data/types' | ||
import CoinBalance from '../../components/CoinBalance' | ||
|
||
const CryptoAccountOption: React.FC<Props> = props => { | ||
const { account, coins, isAccountSelected, walletCurrency } = props | ||
return ( | ||
<Option role='button' data-e2e='changeAcct' onClick={props.onClick}> | ||
<FlexStartRow> | ||
<Icon | ||
name={coins[account.coin].icons.circleFilled} | ||
color={coins[account.coin].colorCode} | ||
size='32px' | ||
style={{ marginRight: '16px' }} | ||
/> | ||
<div> | ||
<OptionTitle>{account.label}</OptionTitle> | ||
<OptionValue> | ||
<BalanceRow> | ||
<CoinBalance account={account} walletCurrency={walletCurrency} /> | ||
</BalanceRow> | ||
</OptionValue> | ||
</div> | ||
</FlexStartRow> | ||
<FlexStartRow> | ||
{account.type === 'CUSTODIAL' && ( | ||
<SuccessCartridge>Low Fees</SuccessCartridge> | ||
)} | ||
{isAccountSelected ? ( | ||
<Icon | ||
name='checkmark-circle-filled' | ||
color='green600' | ||
size='24px' | ||
style={{ padding: '0 2px', marginLeft: '24px' }} | ||
/> | ||
) : ( | ||
<CircleBorder /> | ||
)} | ||
</FlexStartRow> | ||
</Option> | ||
) | ||
} | ||
|
||
type Props = { | ||
account: SwapAccountType | ||
coins: SupportedWalletCurrenciesType | ||
isAccountSelected: boolean | ||
onClick: () => void | ||
walletCurrency: FiatType | ||
} | ||
|
||
export default CryptoAccountOption |
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