1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 12:56:01 +01:00
metamask-extension/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js
dragana8 6d786a7bbf
hide eth amount (#12435)
fix

review updates

moved logic to upper component
2021-11-05 06:42:23 -02:30

71 lines
2.0 KiB
JavaScript

/* eslint-disable no-negated-condition */
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Identicon from '../../../../ui/identicon';
const ConfirmPageContainerSummary = (props) => {
const {
action,
title,
titleComponent,
subtitleComponent,
hideSubtitle,
className,
identiconAddress,
nonce,
origin,
hideTitle,
} = 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">
<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">
{identiconAddress && (
<Identicon
className="confirm-page-container-summary__identicon"
diameter={36}
address={identiconAddress}
/>
)}
{!hideTitle ? (
<div className="confirm-page-container-summary__title-text">
{titleComponent || title}
</div>
) : null}
</div>
{hideSubtitle || (
<div className="confirm-page-container-summary__subtitle">
{subtitleComponent}
</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,
origin: PropTypes.string.isRequired,
hideTitle: PropTypes.boolean,
};
export default ConfirmPageContainerSummary;