1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-11 20:27:12 +01:00
metamask-extension/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js

69 lines
1.9 KiB
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Identicon from '../../../../ui/identicon';
2020-02-15 21:34:12 +01:00
const ConfirmPageContainerSummary = (props) => {
const {
action,
title,
titleComponent,
subtitleComponent,
hideSubtitle,
className,
identiconAddress,
nonce,
assetImage,
origin,
} = props;
return (
<div className={classnames('confirm-page-container-summary', className)}>
{origin === 'metamask' ? null : (
<div className="confirm-page-container-summary__origin">{origin}</div>
)}
<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>
)}
</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}
image={assetImage}
/>
)}
<div className="confirm-page-container-summary__title-text">
2020-11-03 00:41:28 +01:00
{titleComponent || title}
</div>
</div>
2020-11-03 00:41:28 +01:00
{hideSubtitle || (
<div className="confirm-page-container-summary__subtitle">
{subtitleComponent}
2020-11-03 00:41:28 +01:00
</div>
)}
</div>
);
};
ConfirmPageContainerSummary.propTypes = {
action: PropTypes.string,
title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
titleComponent: PropTypes.node,
subtitleComponent: PropTypes.node,
hideSubtitle: PropTypes.bool,
className: PropTypes.string,
identiconAddress: PropTypes.string,
nonce: PropTypes.string,
2018-08-30 04:13:25 +02:00
assetImage: PropTypes.string,
origin: PropTypes.string.isRequired,
};
export default ConfirmPageContainerSummary;