You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.5 KiB
48 lines
1.5 KiB
4 years ago
|
import React, { PureComponent } from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import classnames from 'classnames';
|
||
6 years ago
|
|
||
|
import {
|
||
|
TRANSACTION_CREATED_EVENT,
|
||
|
TRANSACTION_SUBMITTED_EVENT,
|
||
|
TRANSACTION_RESUBMITTED_EVENT,
|
||
|
TRANSACTION_CONFIRMED_EVENT,
|
||
|
TRANSACTION_DROPPED_EVENT,
|
||
|
TRANSACTION_ERRORED_EVENT,
|
||
|
TRANSACTION_CANCEL_ATTEMPTED_EVENT,
|
||
|
TRANSACTION_CANCEL_SUCCESS_EVENT,
|
||
4 years ago
|
} from '../transaction-activity-log.constants';
|
||
6 years ago
|
|
||
|
const imageHash = {
|
||
|
[TRANSACTION_CREATED_EVENT]: '/images/icons/new.svg',
|
||
|
[TRANSACTION_SUBMITTED_EVENT]: '/images/icons/submitted.svg',
|
||
|
[TRANSACTION_RESUBMITTED_EVENT]: '/images/icons/retry.svg',
|
||
|
[TRANSACTION_CONFIRMED_EVENT]: '/images/icons/confirm.svg',
|
||
|
[TRANSACTION_DROPPED_EVENT]: '/images/icons/cancelled.svg',
|
||
|
[TRANSACTION_ERRORED_EVENT]: '/images/icons/error.svg',
|
||
|
[TRANSACTION_CANCEL_ATTEMPTED_EVENT]: '/images/icons/cancelled.svg',
|
||
|
[TRANSACTION_CANCEL_SUCCESS_EVENT]: '/images/icons/cancelled.svg',
|
||
4 years ago
|
};
|
||
6 years ago
|
|
||
|
export default class TransactionActivityLogIcon extends PureComponent {
|
||
|
static contextTypes = {
|
||
|
t: PropTypes.func,
|
||
4 years ago
|
};
|
||
6 years ago
|
|
||
|
static propTypes = {
|
||
|
className: PropTypes.string,
|
||
|
eventKey: PropTypes.oneOf(Object.keys(imageHash)),
|
||
4 years ago
|
};
|
||
6 years ago
|
|
||
4 years ago
|
render() {
|
||
4 years ago
|
const { className, eventKey } = this.props;
|
||
|
const imagePath = imageHash[eventKey];
|
||
6 years ago
|
|
||
|
return (
|
||
|
<div className={classnames('transaction-activity-log-icon', className)}>
|
||
4 years ago
|
{imagePath && <img src={imagePath} height="9" width="9" alt="" />}
|
||
6 years ago
|
</div>
|
||
4 years ago
|
);
|
||
6 years ago
|
}
|
||
|
}
|