From 17b282b1d743c83a4a4378eb71df098949569bdd Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 19 Oct 2018 13:42:42 -0700
Subject: wip: retry button

---
 packages/instant/src/components/buy_button.tsx | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

(limited to 'packages/instant/src/components/buy_button.tsx')

diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 3ef7c1f5c..4d2386620 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -24,15 +24,14 @@ export class BuyButton extends React.Component<BuyButtonProps> {
         onBuyFailure: util.boundNoop,
     };
     public render(): React.ReactNode {
+        // TODO: move container out
         const shouldDisableButton = _.isUndefined(this.props.buyQuote);
         return (
-            <Container padding="20px" width="100%">
-                <Button width="100%" onClick={this._handleClick} isDisabled={shouldDisableButton}>
-                    <Text fontColor={ColorOption.white} fontWeight={600} fontSize="20px">
-                        {this.props.text}
-                    </Text>
-                </Button>
-            </Container>
+            <Button width="100%" onClick={this._handleClick} isDisabled={shouldDisableButton}>
+                <Text fontColor={ColorOption.white} fontWeight={600} fontSize="20px">
+                    {this.props.text}
+                </Text>
+            </Button>
         );
     }
     private readonly _handleClick = async () => {
@@ -43,10 +42,13 @@ export class BuyButton extends React.Component<BuyButtonProps> {
         this.props.onClick(this.props.buyQuote);
         let txnHash;
         try {
-            txnHash = await this.props.assetBuyer.executeBuyQuoteAsync(this.props.buyQuote);
+            txnHash = await this.props.assetBuyer.executeBuyQuoteAsync(this.props.buyQuote, {
+                gasLimit: 5000000,
+            });
             await web3Wrapper.awaitTransactionSuccessAsync(txnHash);
             this.props.onBuySuccess(this.props.buyQuote, txnHash);
-        } catch {
+        } catch (e) {
+            console.log('error', e);
             this.props.onBuyFailure(this.props.buyQuote, txnHash);
         }
     };
-- 
cgit v1.2.3


From d2766d7ced990efd5a91441b459f36e8a21f8513 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 19 Oct 2018 14:49:38 -0700
Subject: Selected Asset button

---
 packages/instant/src/components/buy_button.tsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'packages/instant/src/components/buy_button.tsx')

diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 4d2386620..5eef18aa3 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -6,7 +6,7 @@ import { ColorOption } from '../style/theme';
 import { util } from '../util/util';
 import { web3Wrapper } from '../util/web3_wrapper';
 
-import { Button, Container, Text } from './ui';
+import { Button, Text } from './ui';
 
 export interface BuyButtonProps {
     buyQuote?: BuyQuote;
@@ -14,7 +14,6 @@ export interface BuyButtonProps {
     onClick: (buyQuote: BuyQuote) => void;
     onBuySuccess: (buyQuote: BuyQuote, txnHash: string) => void;
     onBuyFailure: (buyQuote: BuyQuote, tnxHash?: string) => void;
-    text: string;
 }
 
 export class BuyButton extends React.Component<BuyButtonProps> {
@@ -24,12 +23,11 @@ export class BuyButton extends React.Component<BuyButtonProps> {
         onBuyFailure: util.boundNoop,
     };
     public render(): React.ReactNode {
-        // TODO: move container out
         const shouldDisableButton = _.isUndefined(this.props.buyQuote);
         return (
             <Button width="100%" onClick={this._handleClick} isDisabled={shouldDisableButton}>
                 <Text fontColor={ColorOption.white} fontWeight={600} fontSize="20px">
-                    {this.props.text}
+                    Buy
                 </Text>
             </Button>
         );
-- 
cgit v1.2.3


From 51779fec38a32c0bbbc0209559f84aeda8a45d1a Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 19 Oct 2018 16:11:01 -0700
Subject: linting

---
 packages/instant/src/components/buy_button.tsx | 1 -
 1 file changed, 1 deletion(-)

(limited to 'packages/instant/src/components/buy_button.tsx')

diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 5eef18aa3..9a3ded699 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -46,7 +46,6 @@ export class BuyButton extends React.Component<BuyButtonProps> {
             await web3Wrapper.awaitTransactionSuccessAsync(txnHash);
             this.props.onBuySuccess(this.props.buyQuote, txnHash);
         } catch (e) {
-            console.log('error', e);
             this.props.onBuyFailure(this.props.buyQuote, txnHash);
         }
     };
-- 
cgit v1.2.3


From a766d78706cb45336263388360584390fe0e62f2 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 19 Oct 2018 16:39:42 -0700
Subject: Remove hack fix

---
 packages/instant/src/components/buy_button.tsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'packages/instant/src/components/buy_button.tsx')

diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 9a3ded699..2def34fd7 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -40,12 +40,10 @@ export class BuyButton extends React.Component<BuyButtonProps> {
         this.props.onClick(this.props.buyQuote);
         let txnHash;
         try {
-            txnHash = await this.props.assetBuyer.executeBuyQuoteAsync(this.props.buyQuote, {
-                gasLimit: 5000000,
-            });
+            txnHash = await this.props.assetBuyer.executeBuyQuoteAsync(this.props.buyQuote);
             await web3Wrapper.awaitTransactionSuccessAsync(txnHash);
             this.props.onBuySuccess(this.props.buyQuote, txnHash);
-        } catch (e) {
+        } catch {
             this.props.onBuyFailure(this.props.buyQuote, txnHash);
         }
     };
-- 
cgit v1.2.3

