|
|
@ -3,8 +3,9 @@ import PropTypes from 'prop-types' |
|
|
|
import classnames from 'classnames' |
|
|
|
import classnames from 'classnames' |
|
|
|
import { getActivities } from './transaction-activity-log.util' |
|
|
|
import { getActivities } from './transaction-activity-log.util' |
|
|
|
import Card from '../card' |
|
|
|
import Card from '../card' |
|
|
|
import { getEthConversionFromWeiHex } from '../../helpers/conversions.util' |
|
|
|
import { getEthConversionFromWeiHex, getValueFromWeiHex } from '../../helpers/conversions.util' |
|
|
|
import { ETH } from '../../constants/common' |
|
|
|
import { ETH } from '../../constants/common' |
|
|
|
|
|
|
|
import { formatDate } from '../../util' |
|
|
|
|
|
|
|
|
|
|
|
export default class TransactionActivityLog extends PureComponent { |
|
|
|
export default class TransactionActivityLog extends PureComponent { |
|
|
|
static contextTypes = { |
|
|
|
static contextTypes = { |
|
|
@ -41,8 +42,17 @@ export default class TransactionActivityLog extends PureComponent { |
|
|
|
|
|
|
|
|
|
|
|
renderActivity (activity, index) { |
|
|
|
renderActivity (activity, index) { |
|
|
|
const { conversionRate } = this.props |
|
|
|
const { conversionRate } = this.props |
|
|
|
const { eventKey, value } = activity |
|
|
|
const { eventKey, value, timestamp } = activity |
|
|
|
const ethValue = getEthConversionFromWeiHex({ value, toCurrency: ETH, conversionRate }) |
|
|
|
const ethValue = index === 0 |
|
|
|
|
|
|
|
? `${getValueFromWeiHex({ |
|
|
|
|
|
|
|
value, |
|
|
|
|
|
|
|
toCurrency: ETH, |
|
|
|
|
|
|
|
conversionRate, |
|
|
|
|
|
|
|
numberOfDecimals: 6, |
|
|
|
|
|
|
|
})} ${ETH}` |
|
|
|
|
|
|
|
: getEthConversionFromWeiHex({ value, toCurrency: ETH, conversionRate }) |
|
|
|
|
|
|
|
const formattedTimestamp = formatDate(timestamp) |
|
|
|
|
|
|
|
const activityText = this.context.t(eventKey, [ethValue, formattedTimestamp]) |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<div |
|
|
@ -50,8 +60,11 @@ export default class TransactionActivityLog extends PureComponent { |
|
|
|
className="transaction-activity-log__activity" |
|
|
|
className="transaction-activity-log__activity" |
|
|
|
> |
|
|
|
> |
|
|
|
<div className="transaction-activity-log__activity-icon" /> |
|
|
|
<div className="transaction-activity-log__activity-icon" /> |
|
|
|
<div className="transaction-activity-log__activity-text"> |
|
|
|
<div |
|
|
|
{ this.context.t(eventKey, [ethValue]) } |
|
|
|
className="transaction-activity-log__activity-text" |
|
|
|
|
|
|
|
title={activityText} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{ activityText } |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) |
|
|
|
) |
|
|
|