// @flow import React from 'react'; import { Text, View, Linking } from 'react-native'; import { buildURI, formatCredits } from 'lbry-redux'; import Link from '../../link'; import moment from 'moment'; import transactionListStyle from '../../../styles/transactionList'; class TransactionListItem extends React.PureComponent { capitalize(string: string) { return string.charAt(0).toUpperCase() + string.slice(1); } render() { const { transaction, navigation } = this.props; const { amount, claim_id: claimId, claim_name: name, date, fee, txid, type } = transaction; return ( {this.capitalize(type)} {name && claimId && ( navigation && navigation.navigate({ routeName: 'File', key: evt.Url, params: { uri: buildURI({ claimName: name, claimId }) }}) } text={name} /> )} {formatCredits(amount, 8)} { fee !== 0 && (fee {formatCredits(fee, 8)}) } {date ? ( {moment(date).format('MMM D')} ) : ( Pending )} ); } } export default TransactionListItem;