diff options
author | Brandon Millman <brandon@0xproject.com> | 2018-12-11 02:54:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-11 02:54:08 +0800 |
commit | d050a1bd534695288b6da0b01e58aba1dff0e63e (patch) | |
tree | ee640acb04f545350dc5011f64f17419daef2661 /packages | |
parent | 6c86cc8ab87ae6f8d435546ec80161faee7bce74 (diff) | |
parent | dc21c79f2b182917852649dee8f83ba621f79acf (diff) | |
download | dexon-0x-contracts-d050a1bd534695288b6da0b01e58aba1dff0e63e.tar.gz dexon-0x-contracts-d050a1bd534695288b6da0b01e58aba1dff0e63e.tar.zst dexon-0x-contracts-d050a1bd534695288b6da0b01e58aba1dff0e63e.zip |
Merge pull request #1411 from 0xProject/fix/instant/hide-loaders
[instant] Hide loaders when no token or buy amount is chosen
Diffstat (limited to 'packages')
-rw-r--r-- | packages/instant/src/components/instant_heading.tsx | 19 |
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 { |