diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-01-09 08:35:12 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-01-09 08:35:12 +0800 |
commit | 734cf5819aee5d46719d1ca387666bfda6e475bd (patch) | |
tree | 264785cb0666e011b49842b47ac4b2408dddaa28 /packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx | |
parent | 9f3acf8e2888b6105062e47664ecd5adaaf3c889 (diff) | |
parent | 35e0b6143ab1405259471e1c9c698bfcd869df5a (diff) | |
download | dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.gz dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.bz2 dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.lz dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.xz dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.zst dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.zip |
Merge branch 'development' into fix/mutatedInput
* development:
Changes to abi-gen after code review
Added constructor ABIs to abi-gen
Describe #295 in a CHANGELOG
Add #302 description to changelog
Fix formatting
Apply prettier config
Install prettier
Remove formatting esilnt rules
sendTransactionAsync should return txHash string
Added Event generation to abi-gen
Publish
Add dates to CHANGELOG entries
Update subproviders CHANGELOG
Support both personal_sign and eth_sign
Fix Ledger tests given change from `personal_sign` to `eth_sign`
Update subprovider to catch correct RPC method
Rename guide
Update contribution guide
Fix broken links in the abi-gen README
Fix typing generation for arrays in which types separated by |s
Diffstat (limited to 'packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx')
-rw-r--r-- | packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx | 89 |
1 files changed, 37 insertions, 52 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 d78cbdc29..ae4328976 100644 --- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx +++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx @@ -2,10 +2,10 @@ import BigNumber from 'bignumber.js'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import * as React from 'react'; -import {EthAmountInput} from 'ts/components/inputs/eth_amount_input'; -import {TokenAmountInput} from 'ts/components/inputs/token_amount_input'; -import {Side, Token, TokenState} from 'ts/types'; -import {colors} from 'ts/utils/colors'; +import { EthAmountInput } from 'ts/components/inputs/eth_amount_input'; +import { TokenAmountInput } from 'ts/components/inputs/token_amount_input'; +import { Side, Token, TokenState } from 'ts/types'; +import { colors } from 'ts/utils/colors'; interface EthWethConversionDialogProps { direction: Side; @@ -23,8 +23,10 @@ interface EthWethConversionDialogState { hasErrors: boolean; } -export class EthWethConversionDialog extends - React.Component<EthWethConversionDialogProps, EthWethConversionDialogState> { +export class EthWethConversionDialog extends React.Component< + EthWethConversionDialogProps, + EthWethConversionDialogState +> { constructor() { super(); this.state = { @@ -34,25 +36,16 @@ export class EthWethConversionDialog extends } public render() { const convertDialogActions = [ - <FlatButton - key="cancel" - label="Cancel" - onTouchTap={this._onCancel.bind(this)} - />, - <FlatButton - key="convert" - label="Convert" - primary={true} - onTouchTap={this._onConvertClick.bind(this)} - />, + <FlatButton key="cancel" label="Cancel" onTouchTap={this._onCancel.bind(this)} />, + <FlatButton key="convert" label="Convert" primary={true} onTouchTap={this._onConvertClick.bind(this)} />, ]; - const title = this.props.direction === Side.Deposit ? 'Wrap ETH' : 'Unwrap WETH'; + const title = this.props.direction === Side.Deposit ? 'Wrap ETH' : 'Unwrap WETH'; return ( <Dialog title={title} - titleStyle={{fontWeight: 100}} + titleStyle={{ fontWeight: 100 }} actions={convertDialogActions} - contentStyle={{width: 448}} + contentStyle={{ width: 448 }} open={this.props.isOpen} > {this._renderConversionDialogBody()} @@ -60,31 +53,24 @@ export class EthWethConversionDialog extends ); } private _renderConversionDialogBody() { - const explanation = this.props.direction === Side.Deposit ? - 'Convert your Ether into a tokenized, tradable form.' : - 'Convert your Wrapped Ether back into it\'s native form.'; + const explanation = + this.props.direction === Side.Deposit + ? '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; return ( <div> - <div className="pb2"> - {explanation} - </div> - <div className="mx-auto" style={{maxWidth: 312}}> + <div className="pb2">{explanation}</div> + <div className="mx-auto" style={{ maxWidth: 312 }}> <div className="flex"> {this._renderCurrency(isWrappedVersion)} - <div style={{paddingTop: 68}}> - <i - style={{fontSize: 28, color: colors.darkBlue}} - className="zmdi zmdi-arrow-right" - /> + <div style={{ paddingTop: 68 }}> + <i style={{ fontSize: 28, color: colors.darkBlue }} className="zmdi zmdi-arrow-right" /> </div> {this._renderCurrency(!isWrappedVersion)} </div> - <div - className="pt2 mx-auto" - style={{width: 245}} - > - {this.props.direction === Side.Receive ? + <div className="pt2 mx-auto" style={{ width: 245 }}> + {this.props.direction === Side.Receive ? ( <TokenAmountInput token={this.props.token} tokenState={this.props.tokenState} @@ -94,7 +80,8 @@ export class EthWethConversionDialog extends onChange={this._onValueChange.bind(this)} amount={this.state.value} onVisitBalancesPageClick={this.props.onCancelled} - /> : + /> + ) : ( <EthAmountInput balance={this.props.etherBalance} amount={this.state.value} @@ -103,21 +90,22 @@ export class EthWethConversionDialog extends shouldShowIncompleteErrs={this.state.shouldShowIncompleteErrs} onVisitBalancesPageClick={this.props.onCancelled} /> - } - <div - className="pt1" - style={{fontSize: 12}} - > + )} + <div className="pt1" style={{ fontSize: 12 }}> <div className="left">1 ETH = 1 WETH</div> - {this.props.direction === Side.Receive && + {this.props.direction === Side.Receive && ( <div className="right" onClick={this._onMaxClick.bind(this)} - style={{color: colors.darkBlue, textDecoration: 'underline', cursor: 'pointer'}} + style={{ + color: colors.darkBlue, + textDecoration: 'underline', + cursor: 'pointer', + }} > Max </div> - } + )} </div> </div> </div> @@ -130,16 +118,13 @@ export class EthWethConversionDialog extends const symbol = isWrappedVersion ? 'WETH' : 'ETH'; return ( <div className="mx-auto pt2"> - <div - className="center" - style={{color: colors.darkBlue}} - > + <div className="center" style={{ color: colors.darkBlue }}> {name} </div> <div className="center py2"> - <img src={iconUrl} style={{width: 60}} /> + <img src={iconUrl} style={{ width: 60 }} /> </div> - <div className="center" style={{fontSize: 12}}> + <div className="center" style={{ fontSize: 12 }}> ({symbol}) </div> </div> |