Skip to content

Commit

Permalink
fix(activity-feed): custodial tx items
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Dec 8, 2020
1 parent bea184c commit 124f78d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,72 +81,79 @@ const CryptoSelector: React.FC<InjectedFormProps<{}, Props> &
}

// Check to see if any accounts have balance

// @ts-ignore
const checkAccountsBalances = any(hasFunds => hasFunds)(
// @ts-ignore
values(
// @ts-ignore
map(
// @ts-ignore
coin => any(acct => acct.balance !== 0 && acct.balance !== '0')(coin),
// @ts-ignore
props.accounts
)
)
)


return (
<Wrapper>
<Form>
<FlyoutWrapper>
<Top>
<Icon cursor name='cart-filled' size='32px' color='blue600' />
<Icon cursor name="cart-filled" size="32px" color="blue600" />
<Icon
cursor
data-e2e='sbCloseModalIcon'
name='close'
size='20px'
color='grey600'
role='button'
data-e2e="sbCloseModalIcon"
name="close"
size="20px"
color="grey600"
role="button"
onClick={props.handleClose}
/>
</Top>
<TopText color='grey800' size='20px' weight={600}>
<TopText color="grey800" size="20px" weight={600}>
<FormattedMessage
id='modals.simplebuy.cryptoselect'
defaultMessage='Buy Crypto. Sell for Cash.'
id="modals.simplebuy.cryptoselect"
defaultMessage="Buy Crypto. Sell for Cash."
/>
</TopText>
<SubTitleText color='grey600' weight={500}>
<SubTitleText color="grey600" weight={500}>
<FormattedMessage
id='modals.simplebuy.select_crypto'
defaultMessage='Easily buy and sell Crypto straight from your Wallet.'
id="modals.simplebuy.select_crypto"
defaultMessage="Easily buy and sell Crypto straight from your Wallet."
/>
</SubTitleText>
{props.invitations.simpleSell && (
<TabsContainer>
<TabMenu>
<TabMenuItem
role='button'
role="button"
selected={orderType === 'BUY'}
onClick={() => {
setOrderType('BUY')
props.analyticsActions.logEvent('SB_BUY_BUTTON')
}}
data-e2e='sbBuyButton'
data-e2e="sbBuyButton"
>
<FormattedMessage
id='buttons.buy_crypto'
defaultMessage='Buy Crypto'
id="buttons.buy_crypto"
defaultMessage="Buy Crypto"
/>
</TabMenuItem>
<TabMenuItem
role='button'
role="button"
selected={orderType === 'SELL'}
onClick={() => {
setOrderType('SELL')
props.analyticsActions.logEvent('SB_SELL_BUTTON')
}}
data-e2e='sbSellButton'
data-e2e="sbSellButton"
>
<FormattedMessage
id='buttons.sell_crypto'
defaultMessage='Sell Crypto'
id="buttons.sell_crypto"
defaultMessage="Sell Crypto"
/>
</TabMenuItem>
</TabMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const CustodialTxListItem: React.FC<Props> = props => {
data-e2e='orderAmountColumn'
>
<StyledCoinDisplay coin={props.coin} data-e2e='orderCoinAmt'>
{tx.amount.symbol in CoinTypeEnum
{tx.amount.symbol in CoinTypeEnum && tx.type === 'SELL'
? convertBaseToStandard('FIAT', tx.amountMinor)
: tx.amount.value}
</StyledCoinDisplay>
Expand All @@ -82,7 +82,7 @@ const CustodialTxListItem: React.FC<Props> = props => {
color='grey600'
data-e2e='orderFiatAmt'
>
{tx.amount.symbol in CoinTypeEnum
{tx.amount.symbol in CoinTypeEnum && tx.type === 'SELL'
? convertBaseToStandard('FIAT', tx.amountMinor)
: tx.amount.value}
</StyledFiatDisplay>
Expand Down Expand Up @@ -128,13 +128,21 @@ const CustodialTxListItem: React.FC<Props> = props => {
<RowValue>
<Status {...props} />
</RowValue>
<RowHeader>
<FormattedMessage id='copy.amount' defaultMessage='Amount' />
</RowHeader>
<RowValue data-e2e='sbSelling'>
{convertBaseToStandard(tx.amount.symbol, tx.amount.inputMoney)} of{' '}
{tx.amount.symbol}
</RowValue>
{tx.type === 'SELL' && (
<>
{' '}
<RowHeader>
<FormattedMessage id='copy.amount' defaultMessage='Amount' />
</RowHeader>
<RowValue data-e2e='sbSelling'>
{convertBaseToStandard(
tx.amount.symbol,
tx.amount.inputMoney
)}{' '}
of {tx.amount.symbol}
</RowValue>
</>
)}
</DetailsColumn>
</DetailsRow>
)}
Expand Down

0 comments on commit 124f78d

Please sign in to comment.