2021-11-05 10:12:23 +01:00
|
|
|
/* eslint-disable no-negated-condition */
|
2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import classnames from 'classnames';
|
|
|
|
import Identicon from '../../../../ui/identicon';
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const ConfirmPageContainerSummary = (props) => {
|
2018-10-17 01:03:29 +02:00
|
|
|
const {
|
|
|
|
action,
|
|
|
|
title,
|
|
|
|
titleComponent,
|
|
|
|
subtitleComponent,
|
|
|
|
hideSubtitle,
|
|
|
|
className,
|
|
|
|
identiconAddress,
|
|
|
|
nonce,
|
2021-01-28 18:59:45 +01:00
|
|
|
origin,
|
2021-11-05 10:12:23 +01:00
|
|
|
hideTitle,
|
2021-02-04 19:15:23 +01:00
|
|
|
} = props;
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={classnames('confirm-page-container-summary', className)}>
|
2021-01-28 18:59:45 +01:00
|
|
|
{origin === 'metamask' ? null : (
|
|
|
|
<div className="confirm-page-container-summary__origin">{origin}</div>
|
|
|
|
)}
|
2018-06-23 08:52:45 +02:00
|
|
|
<div className="confirm-page-container-summary__action-row">
|
2020-11-03 00:41:28 +01:00
|
|
|
<div className="confirm-page-container-summary__action">{action}</div>
|
|
|
|
{nonce && (
|
|
|
|
<div className="confirm-page-container-summary__nonce">
|
|
|
|
{`#${nonce}`}
|
|
|
|
</div>
|
|
|
|
)}
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
|
|
|
<div className="confirm-page-container-summary__title">
|
2020-11-03 00:41:28 +01:00
|
|
|
{identiconAddress && (
|
|
|
|
<Identicon
|
|
|
|
className="confirm-page-container-summary__identicon"
|
|
|
|
diameter={36}
|
|
|
|
address={identiconAddress}
|
|
|
|
/>
|
|
|
|
)}
|
2021-11-05 10:12:23 +01:00
|
|
|
{!hideTitle ? (
|
|
|
|
<div className="confirm-page-container-summary__title-text">
|
|
|
|
{titleComponent || title}
|
|
|
|
</div>
|
|
|
|
) : null}
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
2020-11-03 00:41:28 +01:00
|
|
|
{hideSubtitle || (
|
|
|
|
<div className="confirm-page-container-summary__subtitle">
|
2021-01-28 18:17:26 +01:00
|
|
|
{subtitleComponent}
|
2020-11-03 00:41:28 +01:00
|
|
|
</div>
|
|
|
|
)}
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
ConfirmPageContainerSummary.propTypes = {
|
|
|
|
action: PropTypes.string,
|
|
|
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
2018-10-17 01:03:29 +02:00
|
|
|
titleComponent: PropTypes.node,
|
|
|
|
subtitleComponent: PropTypes.node,
|
2018-06-23 08:52:45 +02:00
|
|
|
hideSubtitle: PropTypes.bool,
|
|
|
|
className: PropTypes.string,
|
|
|
|
identiconAddress: PropTypes.string,
|
|
|
|
nonce: PropTypes.string,
|
2021-01-28 18:59:45 +01:00
|
|
|
origin: PropTypes.string.isRequired,
|
2021-11-05 10:12:23 +01:00
|
|
|
hideTitle: PropTypes.boolean,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export default ConfirmPageContainerSummary;
|