diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-18 07:46:01 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-18 07:46:01 +0800 |
commit | 01b98c3ed09429dac92a46446bb73c8596116d18 (patch) | |
tree | 079ae78a22cfa5abc49ba60d56e5aa39065d2ef7 /packages/instant/src/components | |
parent | 6cf8d57aee3ed332bd1109f8f39792894147d2dd (diff) | |
download | dexon-sol-tools-01b98c3ed09429dac92a46446bb73c8596116d18.tar dexon-sol-tools-01b98c3ed09429dac92a46446bb73c8596116d18.tar.gz dexon-sol-tools-01b98c3ed09429dac92a46446bb73c8596116d18.tar.bz2 dexon-sol-tools-01b98c3ed09429dac92a46446bb73c8596116d18.tar.lz dexon-sol-tools-01b98c3ed09429dac92a46446bb73c8596116d18.tar.xz dexon-sol-tools-01b98c3ed09429dac92a46446bb73c8596116d18.tar.zst dexon-sol-tools-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.tsx | 20 |
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}> + — + </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 => { |