aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-18 07:46:01 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-18 07:46:01 +0800
commit01b98c3ed09429dac92a46446bb73c8596116d18 (patch)
tree079ae78a22cfa5abc49ba60d56e5aa39065d2ef7 /packages/instant/src/components
parent6cf8d57aee3ed332bd1109f8f39792894147d2dd (diff)
downloaddexon-0x-contracts-01b98c3ed09429dac92a46446bb73c8596116d18.tar.gz
dexon-0x-contracts-01b98c3ed09429dac92a46446bb73c8596116d18.tar.zst
dexon-0x-contracts-01b98c3ed09429dac92a46446bb73c8596116d18.zip
ReactNode as default for formatters, and show bold dash
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/instant_heading.tsx20
1 files changed, 16 insertions, 4 deletions
diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx
index 848056800..73a419019 100644
--- a/packages/instant/src/components/instant_heading.tsx
+++ b/packages/instant/src/components/instant_heading.tsx
@@ -16,18 +16,30 @@ export interface InstantHeadingProps {
quoteState: AsyncProcessState;
}
-const displaytotalEthBaseAmount = ({ selectedAssetAmount, totalEthBaseAmount }: InstantHeadingProps): string => {
+const Placeholder = () => (
+ <Text fontWeight="bold" fontColor={ColorOption.white}>
+ &mdash;
+ </Text>
+);
+const displaytotalEthBaseAmount = ({
+ selectedAssetAmount,
+ totalEthBaseAmount,
+}: InstantHeadingProps): React.ReactNode => {
if (_.isUndefined(selectedAssetAmount)) {
return '0 ETH';
}
- return format.ethBaseAmount(totalEthBaseAmount, 4, '-');
+ return format.ethBaseAmount(totalEthBaseAmount, 4, <Placeholder />);
};
-const displayUsdAmount = ({ totalEthBaseAmount, selectedAssetAmount, ethUsdPrice }: InstantHeadingProps): string => {
+const displayUsdAmount = ({
+ totalEthBaseAmount,
+ selectedAssetAmount,
+ ethUsdPrice,
+}: InstantHeadingProps): React.ReactNode => {
if (_.isUndefined(selectedAssetAmount)) {
return '$0.00';
}
- return format.ethBaseAmountInUsd(totalEthBaseAmount, ethUsdPrice, 2, '-');
+ return format.ethBaseAmountInUsd(totalEthBaseAmount, ethUsdPrice, 2, <Placeholder />);
};
const loadingOrAmount = (quoteState: AsyncProcessState, amount: string): React.ReactNode => {