From 0861bef87051bd98e08682115b446b1fc1400af2 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 6 May 2017 02:41:20 +0900 Subject: [PATCH] Remove duplicate inside coinbasePanel by introducing another function (coinbaseAvailability) Follow up to #8666 Auditors: Test Plan: 1. Open about:preferences#payments 2. Set the budget to 5 USD 3. Click "Add funds" 4. Make sure the button and the title is displayed on the 1st row 5. Set the budget to other than 5 USD 6. Click "Add funds" 7. Make sure 'coinbaseNotAvailable' is displayed --- .../preferences/payment/bitcoinDashboard.js | 70 ++++++++----------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/app/renderer/components/preferences/payment/bitcoinDashboard.js b/app/renderer/components/preferences/payment/bitcoinDashboard.js index f728d53cae..c19e30c602 100644 --- a/app/renderer/components/preferences/payment/bitcoinDashboard.js +++ b/app/renderer/components/preferences/payment/bitcoinDashboard.js @@ -116,53 +116,41 @@ class BitcoinDashboard extends ImmutableComponent { } - coinbasePanel () { + coinbaseAvailability () { if (this.canUseCoinbase) { - return
-
-
-
- {this.faCreditCard()} -
-
-
-
-
-
-
-
- {this.bitcoinPurchaseButton()} -
-
+ return
+ {this.bitcoinPurchaseButton()} +
} else { - return
-
-
-
- {this.faCreditCard()} -
-
-
-
-
-
-
-
-
-
+ return
+
} } + + coinbasePanel () { + return
+
+
+
+ {this.faCreditCard()} +
+
+
+
+
+
+
+ {this.coinbaseAvailability()} +
+ } exchangePanel () { const url = this.props.ledgerData.getIn(['exchangeInfo', 'exchangeURL']) const name = this.props.ledgerData.getIn(['exchangeInfo', 'exchangeName'])