A Metamask fork with Infura removed and default networks editable
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.
ciphermask/ui/components/app/transaction-detail-item/transaction-detail-item.com...

80 lines
2.1 KiB

import React from 'react';
import PropTypes from 'prop-types';
import Typography from '../../ui/typography/typography';
import {
COLORS,
FONT_WEIGHT,
TYPOGRAPHY,
} from '../../../helpers/constants/design-system';
export default function TransactionDetailItem({
detailTitle,
detailText,
detailTotal,
subTitle,
subText,
}) {
return (
<div className="transaction-detail-item">
<div className="transaction-detail-item__row">
<Typography
color={COLORS.BLACK}
fontWeight={FONT_WEIGHT.BOLD}
variant={TYPOGRAPHY.H6}
className="transaction-detail-item__title"
>
{detailTitle}
</Typography>
{detailText && (
<Typography
variant={TYPOGRAPHY.H6}
className="transaction-detail-item__detail-text"
color={COLORS.UI4}
>
{detailText}
</Typography>
)}
<Typography
color={COLORS.BLACK}
fontWeight={FONT_WEIGHT.BOLD}
variant={TYPOGRAPHY.H6}
className="transaction-detail-item__total"
>
{detailTotal}
</Typography>
</div>
<div className="transaction-detail-item__row">
{subTitle && (
<Typography
variant={TYPOGRAPHY.H7}
className="transaction-detail-item__subtitle"
color={COLORS.UI4}
>
{subTitle}
</Typography>
)}
<Typography variant={TYPOGRAPHY.H7} color={COLORS.UI4}>
{subText}
</Typography>
</div>
</div>
);
}
TransactionDetailItem.propTypes = {
detailTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
detailText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
detailTotal: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
subTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
subText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
};
TransactionDetailItem.defaultProps = {
detailTitle: '',
detailText: '',
detailTotal: '',
subTitle: '',
subText: '',
};