aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/dialogs
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
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')
-rw-r--r--packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx6
-rw-r--r--packages/website/ts/components/dialogs/send_dialog.tsx40
2 files changed, 28 insertions, 18 deletions
diff --git a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
index 7b09cc92c..5f4bf8519 100644
--- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
+++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
@@ -1,15 +1,13 @@
import { colors } from '@0xproject/react-shared';
import { BigNumber } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import * as React from 'react';
import { Blockchain } from 'ts/blockchain';
-import { EthAmountInput } from 'ts/components/inputs/eth_amount_input';
import { TokenAmountInput } from 'ts/components/inputs/token_amount_input';
+import { EthAmountInput } from 'ts/containers/inputs/eth_amount_input';
import { Side, Token } from 'ts/types';
-import { constants } from 'ts/utils/constants';
interface EthWethConversionDialogProps {
blockchain: Blockchain;
@@ -78,7 +76,6 @@ export class EthWethConversionDialog extends React.Component<
? 'Convert your Ether into a tokenized, tradable form.'
: "Convert your Wrapped Ether back into it's native form.";
const isWrappedVersion = this.props.direction === Side.Receive;
- const etherBalanceInEth = Web3Wrapper.toUnitAmount(this.props.etherBalanceInWei, constants.DECIMAL_PLACES_ETH);
return (
<div>
<div className="pb2">{explanation}</div>
@@ -106,7 +103,6 @@ export class EthWethConversionDialog extends React.Component<
/>
) : (
<EthAmountInput
- balance={etherBalanceInEth}
amount={this.state.value}
onChange={this._onValueChange.bind(this)}
shouldCheckBalance={true}
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>
);
}