hotfix: use "send" and "receive" for transaction type
This commit is contained in:
parent
cbac64bbae
commit
eb366c1324
|
@ -16,7 +16,7 @@ import formatNumber from '../utils/formatNumber';
|
||||||
|
|
||||||
const Wrapper = styled(RowComponent)`
|
const Wrapper = styled(RowComponent)`
|
||||||
background-color: ${props => props.theme.colors.cardBackgroundColor};
|
background-color: ${props => props.theme.colors.cardBackgroundColor};
|
||||||
padding: 10px 17px;
|
padding: 15px 17px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Icon = styled.img`
|
const Icon = styled.img`
|
||||||
|
@ -40,7 +40,7 @@ const TransactionColumn = styled(ColumnComponent)`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export type Transaction = {
|
export type Transaction = {
|
||||||
type: 'sent' | 'received',
|
type: 'send' | 'receive',
|
||||||
date: string,
|
date: string,
|
||||||
address: string,
|
address: string,
|
||||||
amount: number,
|
amount: number,
|
||||||
|
@ -52,7 +52,7 @@ const truncateAddress = (address: string) => `${address.substr(0, 20)}...${addre
|
||||||
export const TransactionItemComponent = ({
|
export const TransactionItemComponent = ({
|
||||||
type, date, address, amount,
|
type, date, address, amount,
|
||||||
}: Transaction) => {
|
}: Transaction) => {
|
||||||
const isReceived = type === 'received';
|
const isReceived = type === 'receive';
|
||||||
return (
|
return (
|
||||||
<Wrapper alignItems='center' justifyContent='space-between'>
|
<Wrapper alignItems='center' justifyContent='space-between'>
|
||||||
<RowComponent alignItems='center'>
|
<RowComponent alignItems='center'>
|
||||||
|
@ -60,18 +60,18 @@ export const TransactionItemComponent = ({
|
||||||
<Icon src={isReceived ? ReceivedIcon : SentIcon} alt='Transaction Type Icon' />
|
<Icon src={isReceived ? ReceivedIcon : SentIcon} alt='Transaction Type Icon' />
|
||||||
<TransactionColumn>
|
<TransactionColumn>
|
||||||
<TransactionTypeLabel isReceived={isReceived} value={type} />
|
<TransactionTypeLabel isReceived={isReceived} value={type} />
|
||||||
<TransactionTime value={dateFns.format(new Date(date), 'HH:mm')} />
|
<TransactionTime value={dateFns.format(new Date(date), 'HH:mm A')} />
|
||||||
</TransactionColumn>
|
</TransactionColumn>
|
||||||
</RowComponent>
|
</RowComponent>
|
||||||
<TextComponent value={truncateAddress(address)} align='left' />
|
<TextComponent value={truncateAddress(address)} align='left' />
|
||||||
</RowComponent>
|
</RowComponent>
|
||||||
<ColumnComponent>
|
<ColumnComponent alignItems='flex-end'>
|
||||||
<TextComponent
|
<TextComponent
|
||||||
value={formatNumber(amount, `${isReceived ? '+' : '-'}ZEC `)}
|
value={formatNumber({ value: amount, append: `${isReceived ? '+' : '-'}ZEC ` })}
|
||||||
color={isReceived ? theme.colors.transactionReceived : theme.colors.transactionSent}
|
color={isReceived ? theme.colors.transactionReceived : theme.colors.transactionSent}
|
||||||
/>
|
/>
|
||||||
<TextComponent
|
<TextComponent
|
||||||
value={formatNumber(amount, `${isReceived ? '+' : '-'}USD $`)}
|
value={formatNumber({ value: amount, append: `${isReceived ? '+' : '-'}USD $` })}
|
||||||
color={theme.colors.inactiveItem}
|
color={theme.colors.inactiveItem}
|
||||||
/>
|
/>
|
||||||
</ColumnComponent>
|
</ColumnComponent>
|
||||||
|
|
Loading…
Reference in New Issue