Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Commit 18737a0

Browse files
committed
do not show coinbase for unsupported countries
1 parent 777dfea commit 18737a0

File tree

5 files changed

+74
-14
lines changed

5 files changed

+74
-14
lines changed

app/extensions/brave/locales/en-US/preferences.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,13 @@ on=on
6565
notifications=notifications
6666
moneyAdd=Use your debit/credit card
6767
moneyAddSubTitle=No Bitcoin needed!
68-
outsideUSAPayment=Need to buy Bitcoin outside of the USA?
68+
outsideUSAPayment=Buy Bitcoin at our recommended source
6969
coinbaseNotAvailable=Sorry! Adding funds with a credit/debit card is only available for contributions of $5/month at the moment.
7070
add=Fund with debit/credit
7171
transferTime=Transfer may take up to 40 minutes
7272
addFundsTitle=Add funds…
7373
addFunds=Three ways to add funds to your Brave Wallet
74+
addFundsAlternate=Add funds to your Brave Wallet
7475
copyToClipboard=Copy to clipboard
7576
smartphoneTitle=Use your smartphone app to transfer Bitcoin
7677
displayQRCode=Display QR code

js/about/preferences.js

+28-11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const appConfig = require('../constants/appConfig')
1616
const preferenceTabs = require('../constants/preferenceTabs')
1717
const messages = require('../constants/messages')
1818
const settings = require('../constants/settings')
19+
const coinbaseCountries = require('../constants/coinbaseCountries')
1920
const {passwordManagers, extensionIds} = require('../constants/passwordManagers')
2021
const aboutActions = require('./aboutActions')
2122
const getSetting = require('../settings').getSetting
@@ -299,11 +300,15 @@ class BitcoinDashboard extends ImmutableComponent {
299300
</div>
300301
}
301302
get qrcodeOverlayFooter () {
302-
return <div>
303-
<div id='coinbaseLogo' />
304-
<div id='appstoreLogo' />
305-
<div id='playstoreLogo' />
306-
</div>
303+
if (coinbaseCountries.indexOf(this.props.ledgerData.get('countryCode')) > -1) {
304+
return <div>
305+
<div id='coinbaseLogo' />
306+
<a href='https://itunes.apple.com/us/app/coinbase-bitcoin-wallet/id886427730?mt=8' target='_blank' id='appstoreLogo' />
307+
<a href='https://play.google.com/store/apps/details?id=com.coinbase.android' target='_blank' id='playstoreLogo' />
308+
</div>
309+
} else {
310+
return null
311+
}
307312
}
308313
get currency () {
309314
return this.props.ledgerData.get('currency') || 'USD'
@@ -376,11 +381,15 @@ class BitcoinDashboard extends ImmutableComponent {
376381
</div>
377382
}
378383
get panelFooter () {
379-
return <div className='panelFooter'>
380-
<div id='coinbaseLogo' />
381-
<span className='coinbaseMessage' data-l10n-id='coinbaseMessage' />
382-
<Button l10nId='done' className='pull-right whiteButton' onClick={this.props.hideParentOverlay} />
383-
</div>
384+
if (coinbaseCountries.indexOf(this.props.ledgerData.get('countryCode')) > -1) {
385+
return <div className='panelFooter'>
386+
<div id='coinbaseLogo' />
387+
<span className='coinbaseMessage' data-l10n-id='coinbaseMessage' />
388+
<Button l10nId='done' className='pull-right whiteButton' onClick={this.props.hideParentOverlay} />
389+
</div>
390+
} else {
391+
return null
392+
}
384393
}
385394
copyToClipboard (text) {
386395
aboutActions.setClipboard(text)
@@ -806,6 +815,14 @@ class PaymentsTab extends ImmutableComponent {
806815
siteSettings={this.props.siteSettings} />
807816
}
808817

818+
get overlayTitle () {
819+
if (coinbaseCountries.indexOf(this.props.ledgerData.get('countryCode')) > -1) {
820+
return 'addFunds'
821+
} else {
822+
return 'addFundsAlternate'
823+
}
824+
}
825+
809826
get overlayContent () {
810827
return <BitcoinDashboard ledgerData={this.props.ledgerData}
811828
settings={this.props.settings}
@@ -940,7 +957,7 @@ class PaymentsTab extends ImmutableComponent {
940957
return <div id='paymentsContainer'>
941958
{
942959
this.enabled && this.props.addFundsOverlayVisible
943-
? <ModalOverlay title={'addFunds'} content={this.overlayContent} onHide={this.props.hideOverlay.bind(this, 'addFunds')} />
960+
? <ModalOverlay title={this.overlayTitle} content={this.overlayContent} onHide={this.props.hideOverlay.bind(this, 'addFunds')} />
944961
: null
945962
}
946963
{

js/constants/coinbaseCountries.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
3+
* You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
const coinbaseCountries = [
6+
'AT',
7+
'AU',
8+
'BE',
9+
'BG',
10+
'CA',
11+
'CH',
12+
'CY',
13+
'CZ',
14+
'DK',
15+
'ES',
16+
'FI',
17+
'FR',
18+
'GB',
19+
'GR',
20+
'HR',
21+
'HU',
22+
'IE',
23+
'IT',
24+
'LI',
25+
'LV',
26+
'MC',
27+
'MT',
28+
'NL',
29+
'NO',
30+
'PL',
31+
'PT',
32+
'RO',
33+
'SE',
34+
'SG',
35+
'SI',
36+
'SK',
37+
'SM',
38+
'US'
39+
]
40+
41+
module.exports = coinbaseCountries

less/about/preferences.less

+2-1
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,9 @@ div.nextPaymentSubmission {
894894
color: @darkGray;
895895
clear: both;
896896
font-weight: normal;
897-
font-size: 13px;
897+
font-size: 14px;
898898
font-style: italic;
899+
line-height: 1.3em;
899900
}
900901
span {
901902
display: inline-block;

less/modalOverlay.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
height: auto;
6565
margin: 100px auto 0 auto;
6666
background: white;
67-
box-shadow: @buttonShadow;
67+
box-shadow: @dialogShadow;
6868

6969
button.close span {
7070
color: @gray;

0 commit comments

Comments
 (0)