mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
Update CurrencyValue.tsx
This commit is contained in:
@@ -10,10 +10,10 @@ interface Props {
|
||||
currency?: string;
|
||||
exchangeRate?: string;
|
||||
className?: string;
|
||||
accuracy?: number;
|
||||
accuracyUsd?: number;
|
||||
}
|
||||
|
||||
const CurrencyValue = ({ value, currency = '', unit = 'wei', exchangeRate, className, accuracy }: Props) => {
|
||||
const CurrencyValue = ({ value, currency = '', unit = 'wei', exchangeRate, className, accuracyUsd }: Props) => {
|
||||
let unitBn: BigNumber.Value;
|
||||
switch (unit) {
|
||||
case 'wei':
|
||||
@@ -38,7 +38,7 @@ const CurrencyValue = ({ value, currency = '', unit = 'wei', exchangeRate, class
|
||||
</Text>
|
||||
{ exchangeRate !== undefined && exchangeRate !== null &&
|
||||
// TODO: mb need to implement rounding to the first significant digit
|
||||
<Text as="span" variant="secondary" whiteSpace="pre" fontWeight={ 400 }> (${ accuracy ? usdBn.toFixed(accuracy) : usdBn.toFixed() })</Text>
|
||||
<Text as="span" variant="secondary" whiteSpace="pre" fontWeight={ 400 }> (${ accuracyUsd ? usdBn.toFixed(accuracyUsd) : usdBn.toFixed() })</Text>
|
||||
}
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user