aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-16 08:39:52 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-16 08:39:52 +0800
commit18667d739c112955478ab07cb245dc435b31a974 (patch)
tree7162ca289e4516cb8839ad9480245248e4fbbb5a /packages/instant/src
parentfa18db84d976644270adf0815c73a8d6f40cf9a8 (diff)
downloaddexon-sol-tools-18667d739c112955478ab07cb245dc435b31a974.tar
dexon-sol-tools-18667d739c112955478ab07cb245dc435b31a974.tar.gz
dexon-sol-tools-18667d739c112955478ab07cb245dc435b31a974.tar.bz2
dexon-sol-tools-18667d739c112955478ab07cb245dc435b31a974.tar.lz
dexon-sol-tools-18667d739c112955478ab07cb245dc435b31a974.tar.xz
dexon-sol-tools-18667d739c112955478ab07cb245dc435b31a974.tar.zst
dexon-sol-tools-18667d739c112955478ab07cb245dc435b31a974.zip
Hide USD price when ETH-USD price is not available
Diffstat (limited to 'packages/instant/src')
-rw-r--r--packages/instant/src/components/order_details.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/instant/src/components/order_details.tsx b/packages/instant/src/components/order_details.tsx
index 9256d1398..bd31bfba8 100644
--- a/packages/instant/src/components/order_details.tsx
+++ b/packages/instant/src/components/order_details.tsx
@@ -68,6 +68,11 @@ export const EthAmountRow: React.StatelessComponent<EthAmountRowProps> = ({
const fontWeight = shouldEmphasize ? 700 : 400;
const usdFormatter = isEthAmountInBaseUnits ? format.ethBaseAmountInUsd : format.ethUnitAmountInUsd;
const ethFormatter = isEthAmountInBaseUnits ? format.ethBaseAmount : format.ethUnitAmount;
+ const usdPriceSection = _.isUndefined(ethUsdPrice) ? null : (
+ <Container marginRight="3px" display="inline-block">
+ <Text fontColor={ColorOption.lightGrey}>({usdFormatter(ethAmount, ethUsdPrice)})</Text>
+ </Container>
+ );
return (
<Container padding="10px 0px" borderTop="1px dashed" borderColor={ColorOption.feintGrey}>
<Flex justify="space-between">
@@ -75,9 +80,7 @@ export const EthAmountRow: React.StatelessComponent<EthAmountRowProps> = ({
{rowLabel}
</Text>
<Container>
- <Container marginRight="3px" display="inline-block">
- <Text fontColor={ColorOption.lightGrey}>({usdFormatter(ethAmount, ethUsdPrice)})</Text>
- </Container>
+ {usdPriceSection}
<Text fontWeight={fontWeight} fontColor={ColorOption.grey}>
{ethFormatter(ethAmount)}
</Text>