aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/dialogs/send_dialog.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-25 07:02:21 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-25 07:02:21 +0800
commit9c81692d48fed4942fe6482949d6eed3629d4037 (patch)
treeaefc2a71dcfce2589c1e8505e6b64f2e6c9a9dfe /packages/website/ts/components/dialogs/send_dialog.tsx
parentc505ba6f3e05f4bb415f50352fbb124fec3a71ad (diff)
parentfac90c446cc3a79ffe57ae13c685e7555714cf23 (diff)
downloaddexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.gz
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.bz2
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.lz
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.xz
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.zst
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.zip
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/upgrade-allowance-toggles-to-locks-and-checks
Diffstat (limited to 'packages/website/ts/components/dialogs/send_dialog.tsx')
-rw-r--r--packages/website/ts/components/dialogs/send_dialog.tsx40
1 files changed, 27 insertions, 13 deletions
diff --git a/packages/website/ts/components/dialogs/send_dialog.tsx b/packages/website/ts/components/dialogs/send_dialog.tsx
index 8a98fdf69..c1179dbd0 100644
--- a/packages/website/ts/components/dialogs/send_dialog.tsx
+++ b/packages/website/ts/components/dialogs/send_dialog.tsx
@@ -6,6 +6,7 @@ import * as React from 'react';
import { Blockchain } from 'ts/blockchain';
import { AddressInput } from 'ts/components/inputs/address_input';
import { TokenAmountInput } from 'ts/components/inputs/token_amount_input';
+import { EthAmountInput } from 'ts/containers/inputs/eth_amount_input';
import { Token } from 'ts/types';
interface SendDialogProps {
@@ -15,7 +16,7 @@ interface SendDialogProps {
onComplete: (recipient: string, value: BigNumber) => void;
onCancelled: () => void;
isOpen: boolean;
- token: Token;
+ asset: Token | 'ETH';
lastForceTokenStateRefetch: number;
}
@@ -58,23 +59,23 @@ export class SendDialog extends React.Component<SendDialogProps, SendDialogState
);
}
private _renderSendDialogBody(): React.ReactNode {
- return (
- <div className="mx-auto" style={{ maxWidth: 300 }}>
- <div style={{ height: 80 }}>
- <AddressInput
- initialAddress={this.state.recipient}
- updateAddress={this._onRecipientChange.bind(this)}
- isRequired={true}
- label={'Recipient address'}
- hintText={'Address'}
- />
- </div>
+ const input =
+ this.props.asset === 'ETH' ? (
+ <EthAmountInput
+ label="Amount to send"
+ shouldShowIncompleteErrs={this.state.shouldShowIncompleteErrs}
+ shouldCheckBalance={true}
+ shouldShowErrs={true}
+ onChange={this._onValueChange.bind(this)}
+ amount={this.state.value}
+ />
+ ) : (
<TokenAmountInput
blockchain={this.props.blockchain}
userAddress={this.props.userAddress}
networkId={this.props.networkId}
label="Amount to send"
- token={this.props.token}
+ token={this.props.asset}
shouldShowIncompleteErrs={this.state.shouldShowIncompleteErrs}
shouldCheckBalance={true}
shouldCheckAllowance={false}
@@ -82,6 +83,19 @@ export class SendDialog extends React.Component<SendDialogProps, SendDialogState
amount={this.state.value}
lastForceTokenStateRefetch={this.props.lastForceTokenStateRefetch}
/>
+ );
+ return (
+ <div className="mx-auto" style={{ maxWidth: 300 }}>
+ <div style={{ height: 80 }}>
+ <AddressInput
+ initialAddress={this.state.recipient}
+ updateAddress={this._onRecipientChange.bind(this)}
+ isRequired={true}
+ label="Recipient address'"
+ hintText="Address"
+ />
+ </div>
+ {input}
</div>
);
}