Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Wallet/TxHistory.js
import React from 'react'; | import React from 'react'; | ||||
import PropTypes from 'prop-types'; | import PropTypes from 'prop-types'; | ||||
import styled from 'styled-components'; | import styled from 'styled-components'; | ||||
import Tx from './Tx'; | import Tx from './Tx'; | ||||
export const TxLink = styled.a``; | export const TxLink = styled.span` | ||||
color: ${props => props.theme.wallet.text.link}; | |||||
cursor: pointer; | |||||
transition: color 0.3s; | |||||
-webkit-text-decoration-skip: objects; | |||||
`; | |||||
const TxHistory = ({ txs, fiatPrice, fiatCurrency }) => { | const TxHistory = ({ txs, fiatPrice, fiatCurrency }) => { | ||||
const openTxExplorer = transactionId => { | |||||
window.open( | |||||
`https://explorer.be.cash/tx/${transactionId}`, | |||||
'_blank', | |||||
'noopener,noreferrer', | |||||
); | |||||
}; | |||||
return ( | return ( | ||||
<div> | <div> | ||||
{txs.map(tx => ( | {txs.map(tx => ( | ||||
<TxLink | <TxLink | ||||
key={tx.txid} | key={tx.txid} | ||||
href={`https://explorer.be.cash/tx/${tx.txid}`} | role="link" | ||||
target="_blank" | onClick={() => openTxExplorer(tx.txid)} | ||||
rel="noreferrer" | |||||
> | > | ||||
<Tx | <Tx | ||||
data={tx} | data={tx} | ||||
fiatPrice={fiatPrice} | fiatPrice={fiatPrice} | ||||
fiatCurrency={fiatCurrency} | fiatCurrency={fiatCurrency} | ||||
/> | /> | ||||
</TxLink> | </TxLink> | ||||
))} | ))} | ||||
Show All 11 Lines |