2018-06-23 08:52:45 +02:00
|
|
|
import React from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import classnames from 'classnames'
|
2019-03-22 00:03:30 +01:00
|
|
|
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,
|
|
|
|
assetImage,
|
2021-01-28 18:59:45 +01:00
|
|
|
origin,
|
2018-10-17 01:03:29 +02: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}
|
|
|
|
image={assetImage}
|
|
|
|
/>
|
|
|
|
)}
|
2018-06-23 08:52:45 +02:00
|
|
|
<div className="confirm-page-container-summary__title-text">
|
2020-11-03 00:41:28 +01:00
|
|
|
{titleComponent || title}
|
2018-06-23 08:52:45 +02:00
|
|
|
</div>
|
|
|
|
</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>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
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,
|
2018-08-30 04:13:25 +02:00
|
|
|
assetImage: PropTypes.string,
|
2021-01-28 18:59:45 +01:00
|
|
|
origin: PropTypes.string.isRequired,
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export default ConfirmPageContainerSummary
|