Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Home/Tx.js
import React from 'react'; | import React from 'react'; | ||||
import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||
import PropTypes from 'prop-types'; | import PropTypes from 'prop-types'; | ||||
import styled from 'styled-components'; | import styled from 'styled-components'; | ||||
import { | import { | ||||
SendIcon, | SendIcon, | ||||
ReceiveIcon, | ReceiveIcon, | ||||
GenesisIcon, | GenesisIcon, | ||||
UnparsedIcon, | UnparsedIcon, | ||||
} from '@components/Common/CustomIcons'; | } from '@components/Common/CustomIcons'; | ||||
import { currency } from '@components/Common/Ticker'; | import { currency } from '@components/Common/Ticker'; | ||||
import makeBlockie from 'ethereum-blockies-base64'; | |||||
import { Img } from 'react-image'; | |||||
import { fromLegacyDecimals } from '@utils/cashMethods'; | import { fromLegacyDecimals } from '@utils/cashMethods'; | ||||
import { formatBalance, formatDate } from '@utils/formatting'; | import { formatBalance, formatDate } from '@utils/formatting'; | ||||
import TokenIcon from '@components/Tokens/TokenIcon'; | |||||
const TxIcon = styled.div` | const TxIcon = styled.div` | ||||
svg { | svg { | ||||
width: 20px; | width: 20px; | ||||
height: 20px; | height: 20px; | ||||
} | } | ||||
height: 40px; | height: 40px; | ||||
width: 40px; | width: 40px; | ||||
▲ Show 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | return ( | ||||
)} | )} | ||||
<h4>{txDate}</h4> | <h4>{txDate}</h4> | ||||
</LeftTextCtn> | </LeftTextCtn> | ||||
{data.tokenTx ? ( | {data.tokenTx ? ( | ||||
<TokenInfo outgoing={data.outgoingTx}> | <TokenInfo outgoing={data.outgoingTx}> | ||||
{data.tokenTx && data.tokenInfo ? ( | {data.tokenTx && data.tokenInfo ? ( | ||||
<> | <> | ||||
<TxTokenIcon> | <TxTokenIcon> | ||||
{currency.tokenIconsUrl !== '' ? ( | <TokenIcon | ||||
<Img | size={32} | ||||
src={`${currency.tokenIconsUrl}/32/${data.tokenInfo.tokenId}.png`} | tokenId={data.tokenInfo.tokenId} | ||||
unloader={ | |||||
<img | |||||
alt={`identicon of tokenId ${data.tokenInfo.tokenId} `} | |||||
style={{ | |||||
borderRadius: '50%', | |||||
}} | |||||
key={`identicon-${data.tokenInfo.tokenId}`} | |||||
src={makeBlockie( | |||||
data.tokenInfo | |||||
.tokenId, | |||||
)} | |||||
/> | |||||
} | |||||
/> | /> | ||||
) : ( | |||||
<img | |||||
alt={`identicon of tokenId ${data.tokenInfo.tokenId} `} | |||||
style={{ | |||||
borderRadius: '50%', | |||||
}} | |||||
key={`identicon-${data.tokenInfo.tokenId}`} | |||||
src={makeBlockie( | |||||
data.tokenInfo.tokenId, | |||||
)} | |||||
/> | |||||
)} | |||||
</TxTokenIcon> | </TxTokenIcon> | ||||
{data.outgoingTx ? ( | {data.outgoingTx ? ( | ||||
<RightTextCtn> | <RightTextCtn> | ||||
{data.tokenInfo.transactionType === | {data.tokenInfo.transactionType === | ||||
'GENESIS' ? ( | 'GENESIS' ? ( | ||||
<> | <> | ||||
<TokenTxAmt className="genesis"> | <TokenTxAmt className="genesis"> | ||||
+{' '} | +{' '} | ||||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |