2021-02-04 19:15:23 +01:00
|
|
|
import classnames from 'classnames';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import Identicon from '../../../ui/identicon';
|
2020-05-15 20:53:52 +02:00
|
|
|
|
|
|
|
export default class ConnectedAccountsListItem extends PureComponent {
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func.isRequired,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2020-05-15 20:53:52 +02:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
address: PropTypes.string.isRequired,
|
|
|
|
className: PropTypes.string,
|
|
|
|
name: PropTypes.node.isRequired,
|
2020-06-15 21:08:53 +02:00
|
|
|
status: PropTypes.string,
|
|
|
|
action: PropTypes.node,
|
2020-05-15 20:53:52 +02:00
|
|
|
options: PropTypes.node,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2020-05-15 20:53:52 +02:00
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
className: null,
|
|
|
|
options: null,
|
2020-06-15 21:08:53 +02:00
|
|
|
action: null,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2020-05-15 20:53:52 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { address, className, name, status, action, options } = this.props;
|
2020-05-15 20:53:52 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={classnames('connected-accounts-list__row', className)}>
|
|
|
|
<div className="connected-accounts-list__row-content">
|
|
|
|
<Identicon
|
|
|
|
className="connected-accounts-list__identicon"
|
|
|
|
address={address}
|
|
|
|
diameter={32}
|
|
|
|
/>
|
|
|
|
<div>
|
2020-06-15 21:08:53 +02:00
|
|
|
<p className="connected-accounts-list__account-name">
|
|
|
|
<strong>{name}</strong>
|
2020-05-15 20:53:52 +02:00
|
|
|
</p>
|
2020-11-03 00:41:28 +01:00
|
|
|
{status ? (
|
|
|
|
<p className="connected-accounts-list__account-status">
|
|
|
|
|
|
|
|
{status}
|
|
|
|
</p>
|
|
|
|
) : null}
|
2020-06-15 21:08:53 +02:00
|
|
|
{action}
|
2020-05-15 20:53:52 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{options}
|
|
|
|
</div>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2020-05-15 20:53:52 +02:00
|
|
|
}
|
|
|
|
}
|