aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-12-09 01:48:17 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-13 01:19:32 +0800
commit2b7dabeb6e6c0baca8bc36fe19e39dd4000801b2 (patch)
tree0411448aa10594a257aef4ee45ef2721402c31de /packages/instant
parentdde3a0366ba276409b8523f4647264494b8e8c79 (diff)
downloaddexon-sol-tools-2b7dabeb6e6c0baca8bc36fe19e39dd4000801b2.tar
dexon-sol-tools-2b7dabeb6e6c0baca8bc36fe19e39dd4000801b2.tar.gz
dexon-sol-tools-2b7dabeb6e6c0baca8bc36fe19e39dd4000801b2.tar.bz2
dexon-sol-tools-2b7dabeb6e6c0baca8bc36fe19e39dd4000801b2.tar.lz
dexon-sol-tools-2b7dabeb6e6c0baca8bc36fe19e39dd4000801b2.tar.xz
dexon-sol-tools-2b7dabeb6e6c0baca8bc36fe19e39dd4000801b2.tar.zst
dexon-sol-tools-2b7dabeb6e6c0baca8bc36fe19e39dd4000801b2.zip
fix(instant): hide loaders when no token or buy amount is chosen
Diffstat (limited to 'packages/instant')
-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 {