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