aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-18 04:41:24 +0800
committerFabio Berger <me@fabioberger.com>2017-12-18 04:41:24 +0800
commitb2256679bef6c39ee5889f12838d1c2e9d4dd832 (patch)
tree092b0872f077dcfb94ece216af43ce95ff02ef74
parent9e914be975e20771e0f442eb4b4b025d44eb1994 (diff)
downloaddexon-0x-contracts-b2256679bef6c39ee5889f12838d1c2e9d4dd832.tar.gz
dexon-0x-contracts-b2256679bef6c39ee5889f12838d1c2e9d4dd832.tar.zst
dexon-0x-contracts-b2256679bef6c39ee5889f12838d1c2e9d4dd832.zip
Add `Max` convenience button in unwrap WETH dialog
-rw-r--r--packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx16
1 files changed, 15 insertions, 1 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 c8bdced9b..230ac5183 100644
--- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
+++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
@@ -109,7 +109,16 @@ export class EthWethConversionDialog extends
className="pt1"
style={{fontSize: 12}}
>
- 1 ETH = 1 WETH
+ <div className="left">1 ETH = 1 WETH</div>
+ {this.props.direction === Side.receive &&
+ <div
+ className="right"
+ onClick={this.onMaxClick.bind(this)}
+ style={{color: DARK_BLUE, textDecoration: 'underline', cursor: 'pointer'}}
+ >
+ Max
+ </div>
+ }
</div>
</div>
</div>
@@ -137,6 +146,11 @@ export class EthWethConversionDialog extends
</div>
);
}
+ private onMaxClick() {
+ this.setState({
+ value: this.props.tokenState.balance,
+ });
+ }
private onValueChange(isValid: boolean, amount?: BigNumber) {
this.setState({
value: amount,