You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.1 KiB
80 lines
2.1 KiB
4 years ago
|
import React from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import classnames from 'classnames';
|
||
|
import UserPreferencedCurrencyDisplay from '../../user-preferenced-currency-display';
|
||
|
import { PRIMARY, SECONDARY } from '../../../../helpers/constants/common';
|
||
7 years ago
|
|
||
5 years ago
|
const ConfirmDetailRow = (props) => {
|
||
7 years ago
|
const {
|
||
|
label,
|
||
6 years ago
|
primaryText,
|
||
|
secondaryText,
|
||
7 years ago
|
onHeaderClick,
|
||
6 years ago
|
primaryValueTextColor,
|
||
7 years ago
|
headerText,
|
||
|
headerTextClassName,
|
||
6 years ago
|
value,
|
||
4 years ago
|
} = props;
|
||
7 years ago
|
|
||
|
return (
|
||
|
<div className="confirm-detail-row">
|
||
4 years ago
|
<div className="confirm-detail-row__label">{label}</div>
|
||
7 years ago
|
<div className="confirm-detail-row__details">
|
||
4 years ago
|
{headerText && (
|
||
|
<div
|
||
|
className={classnames(
|
||
|
'confirm-detail-row__header-text',
|
||
|
headerTextClassName,
|
||
|
)}
|
||
4 years ago
|
onClick={() => onHeaderClick?.()}
|
||
4 years ago
|
>
|
||
|
{headerText}
|
||
|
</div>
|
||
|
)}
|
||
|
{primaryText ? (
|
||
|
<div
|
||
|
className="confirm-detail-row__primary"
|
||
|
style={{ color: primaryValueTextColor }}
|
||
|
>
|
||
|
{primaryText}
|
||
|
</div>
|
||
|
) : (
|
||
|
<UserPreferencedCurrencyDisplay
|
||
|
className="confirm-detail-row__primary"
|
||
|
type={PRIMARY}
|
||
|
value={value}
|
||
|
showEthLogo
|
||
|
ethLogoHeight="18"
|
||
|
style={{ color: primaryValueTextColor }}
|
||
|
hideLabel
|
||
|
/>
|
||
|
)}
|
||
|
{secondaryText ? (
|
||
|
<div className="confirm-detail-row__secondary">{secondaryText}</div>
|
||
|
) : (
|
||
|
<UserPreferencedCurrencyDisplay
|
||
|
className="confirm-detail-row__secondary"
|
||
|
type={SECONDARY}
|
||
|
value={value}
|
||
|
showEthLogo
|
||
|
hideLabel
|
||
|
/>
|
||
|
)}
|
||
7 years ago
|
</div>
|
||
|
</div>
|
||
4 years ago
|
);
|
||
|
};
|
||
7 years ago
|
|
||
|
ConfirmDetailRow.propTypes = {
|
||
|
headerText: PropTypes.string,
|
||
|
headerTextClassName: PropTypes.string,
|
||
6 years ago
|
label: PropTypes.string,
|
||
|
onHeaderClick: PropTypes.func,
|
||
|
primaryValueTextColor: PropTypes.string,
|
||
|
primaryText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||
|
secondaryText: PropTypes.string,
|
||
|
value: PropTypes.string,
|
||
4 years ago
|
};
|
||
7 years ago
|
|
||
4 years ago
|
export default ConfirmDetailRow;
|