import React from 'react'; import { connect } from 'react-redux'; import translate from 'translations'; import { getRecentWalletTransactions } from 'selectors/transactions'; import { getNetworkConfig } from 'selectors/config'; import { NewTabLink } from 'components/ui'; import RecentTransaction from './RecentTransaction'; import { TransactionStatus } from 'components'; import { IWallet } from 'libs/wallet'; import { NetworkConfig } from 'types/network'; import { AppState } from 'reducers'; import './RecentTransactions.scss'; interface OwnProps { wallet: IWallet; } interface StateProps { recentTransactions: AppState['transactions']['recent']; network: NetworkConfig; } type Props = OwnProps & StateProps; interface State { activeTxHash: string; } class RecentTransactions extends React.Component { public state: State = { activeTxHash: '' }; public render() { const { activeTxHash } = this.state; let content: React.ReactElement; if (activeTxHash) { content = ( ); } else { content = this.renderTxList(); } return
{content}
; } private renderTxList() { const { wallet, recentTransactions, network } = this.props; let explorer: React.ReactElement; if (network.isCustom) { explorer = an explorer for the {network.name} network; } else { explorer = ( {network.blockExplorer.name} ); } return ( {recentTransactions.length ? ( {recentTransactions.map(tx => ( ))}
{translate('SEND_addr')} {translate('SEND_amount_short')} {translate('Sent')}
) : (

No recent MyCrypto transactions found, try checking on {explorer}.

)}

Only recent transactions sent from this address via MyCrypto on the {network.name} network are listed here. If you don't see your transaction, you can view all of them on {explorer}.

); } private setActiveTxHash = (activeTxHash: string) => this.setState({ activeTxHash }); private clearActiveTxHash = () => this.setState({ activeTxHash: '' }); } export default connect((state: AppState): StateProps => ({ recentTransactions: getRecentWalletTransactions(state), network: getNetworkConfig(state) }))(RecentTransactions);