diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-26 09:57:30 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-26 09:57:30 +0800 |
commit | 30809e646be02025d6f9e9ed0ff214d9ace681c8 (patch) | |
tree | 2bd1446ac81a2319a672709ca8ef9cb2dd07c643 /packages/instant/src/components/instant_heading.tsx | |
parent | d5d99b9d2e3c793a95c68c1035246644b3ae80c6 (diff) | |
parent | 4a96dbe085004be49dbbaa435d4552a9c920d823 (diff) | |
download | dexon-sol-tools-30809e646be02025d6f9e9ed0ff214d9ace681c8.tar dexon-sol-tools-30809e646be02025d6f9e9ed0ff214d9ace681c8.tar.gz dexon-sol-tools-30809e646be02025d6f9e9ed0ff214d9ace681c8.tar.bz2 dexon-sol-tools-30809e646be02025d6f9e9ed0ff214d9ace681c8.tar.lz dexon-sol-tools-30809e646be02025d6f9e9ed0ff214d9ace681c8.tar.xz dexon-sol-tools-30809e646be02025d6f9e9ed0ff214d9ace681c8.tar.zst dexon-sol-tools-30809e646be02025d6f9e9ed0ff214d9ace681c8.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/input-fees-rounding
Diffstat (limited to 'packages/instant/src/components/instant_heading.tsx')
-rw-r--r-- | packages/instant/src/components/instant_heading.tsx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx index df9856277..1ef276ff3 100644 --- a/packages/instant/src/components/instant_heading.tsx +++ b/packages/instant/src/components/instant_heading.tsx @@ -4,12 +4,13 @@ import * as React from 'react'; import { SelectedERC20AssetAmountInput } from '../containers/selected_erc20_asset_amount_input'; import { ColorOption } from '../style/theme'; -import { AsyncProcessState, OrderState } from '../types'; +import { AsyncProcessState, OrderProcessState, OrderState } from '../types'; import { format } from '../util/format'; import { AmountPlaceholder } from './amount_placeholder'; import { Container, Flex, Text } from './ui'; import { Icon } from './ui/icon'; +import { Spinner } from './ui/spinner'; export interface InstantHeadingProps { selectedAssetAmount?: BigNumber; @@ -70,9 +71,11 @@ export class InstantHeading extends React.Component<InstantHeadingProps, {}> { private _renderIcon(): React.ReactNode { const processState = this.props.buyOrderState.processState; - if (processState === AsyncProcessState.FAILURE) { + if (processState === OrderProcessState.FAILURE) { return <Icon icon={'failed'} width={ICON_WIDTH} height={ICON_HEIGHT} color={ICON_COLOR} />; - } else if (processState === AsyncProcessState.SUCCESS) { + } else if (processState === OrderProcessState.PROCESSING) { + return <Spinner widthPx={ICON_HEIGHT} heightPx={ICON_HEIGHT} />; + } else if (processState === OrderProcessState.SUCCESS) { return <Icon icon={'success'} width={ICON_WIDTH} height={ICON_HEIGHT} color={ICON_COLOR} />; } return undefined; @@ -80,9 +83,11 @@ export class InstantHeading extends React.Component<InstantHeadingProps, {}> { private _renderTopText(): React.ReactNode { const processState = this.props.buyOrderState.processState; - if (processState === AsyncProcessState.FAILURE) { + if (processState === OrderProcessState.FAILURE) { return 'Order failed'; - } else if (processState === AsyncProcessState.SUCCESS) { + } else if (processState === OrderProcessState.PROCESSING) { + return 'Processing Order...'; + } else if (processState === OrderProcessState.SUCCESS) { return 'Tokens received!'; } |