Commit 0c3fe54f authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Update CurrencyValue.tsx

parent 461701f2
...@@ -10,10 +10,10 @@ interface Props { ...@@ -10,10 +10,10 @@ interface Props {
currency?: string; currency?: string;
exchangeRate?: string; exchangeRate?: string;
className?: 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; let unitBn: BigNumber.Value;
switch (unit) { switch (unit) {
case 'wei': case 'wei':
...@@ -38,7 +38,7 @@ const CurrencyValue = ({ value, currency = '', unit = 'wei', exchangeRate, class ...@@ -38,7 +38,7 @@ const CurrencyValue = ({ value, currency = '', unit = 'wei', exchangeRate, class
</Text> </Text>
{ exchangeRate !== undefined && exchangeRate !== null && { exchangeRate !== undefined && exchangeRate !== null &&
// TODO: mb need to implement rounding to the first significant digit // 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> </Box>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment