aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-12-09 01:48:17 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-12-11 02:17:41 +0800
commitdc21c79f2b182917852649dee8f83ba621f79acf (patch)
treead8f2a98db07374b96a2538cd7060dcfdfe3dc8b /packages/instant/src/components
parent8d93413a5d49bcafe4b5d0dee359cc09afce7222 (diff)
downloaddexon-sol-tools-dc21c79f2b182917852649dee8f83ba621f79acf.tar
dexon-sol-tools-dc21c79f2b182917852649dee8f83ba621f79acf.tar.gz
dexon-sol-tools-dc21c79f2b182917852649dee8f83ba621f79acf.tar.bz2
dexon-sol-tools-dc21c79f2b182917852649dee8f83ba621f79acf.tar.lz
dexon-sol-tools-dc21c79f2b182917852649dee8f83ba621f79acf.tar.xz
dexon-sol-tools-dc21c79f2b182917852649dee8f83ba621f79acf.tar.zst
dexon-sol-tools-dc21c79f2b182917852649dee8f83ba621f79acf.zip
fix(instant): hide loaders when no token or buy amount is chosen
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/instant_heading.tsx19
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx
index 117f9dd5f..816cc5c33 100644
--- a/packages/instant/src/components/instant_heading.tsx
+++ b/packages/instant/src/components/instant_heading.tsx
@@ -61,12 +61,19 @@ export class InstantHeading extends React.Component<InstantHeadingProps, {}> {
}
private _renderAmountsSection(): React.ReactNode {
- return (
- <Container>
- <Container marginBottom="5px">{this._renderPlaceholderOrAmount(this._renderEthAmount)}</Container>
- <Container opacity={0.7}>{this._renderPlaceholderOrAmount(this._renderDollarAmount)}</Container>
- </Container>
- );
+ if (
+ _.isUndefined(this.props.totalEthBaseUnitAmount) &&
+ this.props.quoteRequestState !== AsyncProcessState.Pending
+ ) {
+ return null;
+ } else {
+ return (
+ <Container>
+ <Container marginBottom="5px">{this._renderPlaceholderOrAmount(this._renderEthAmount)}</Container>
+ <Container opacity={0.7}>{this._renderPlaceholderOrAmount(this._renderDollarAmount)}</Container>
+ </Container>
+ );
+ }
}
private _renderIcon(): React.ReactNode {