Extract unit name
This commit is contained in:
parent
dcc125293a
commit
40c2547565
|
@ -6,6 +6,7 @@ type TransactionValueProps = {
|
|||
value: BigNumber;
|
||||
decimals?: number;
|
||||
hideUnit?: boolean;
|
||||
unitName?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -22,16 +23,17 @@ const TransactionValue: React.FC<TransactionValueProps> = ({
|
|||
value,
|
||||
decimals = 18,
|
||||
hideUnit,
|
||||
unitName = "ETH",
|
||||
}) => {
|
||||
const formattedValue = formatValue(value, decimals);
|
||||
|
||||
return (
|
||||
<span
|
||||
className={`text-sm ${value.isZero() ? "text-gray-400" : ""}`}
|
||||
title={`${formattedValue} Ether`}
|
||||
title={`${formattedValue} ${unitName}`}
|
||||
>
|
||||
<span className={`font-balance`}>{formattedValue}</span>
|
||||
{!hideUnit && " Ether"}
|
||||
{!hideUnit && ` ${unitName}`}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue