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

Commit

Permalink
display different payment options based on user location
Browse files Browse the repository at this point in the history
  • Loading branch information
jkup committed Sep 12, 2016
1 parent d6a8b6d commit 403987e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sync=Sync
privacy=Privacy
shields=Shields
security=Security
visit=visit
visits=Visits
publisher=Site
publishers=Publishers
Expand Down Expand Up @@ -63,6 +64,7 @@ on=on
notifications=notifications
moneyAdd=Use your debit/credit card
moneyAddSubTitle=No Bitcoin needed!
outsideUSAPayment=Need to buy Bitcoin outside of the USA?
coinbaseNotAvailable=Sorry! Adding funds with a credit/debit card is only available for contributions of $5/month at the moment.
add=Fund with debit/credit
transferTime=Transfer may take up to 40 minutes
Expand Down
21 changes: 20 additions & 1 deletion js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ class BitcoinDashboard extends ImmutableComponent {
get canUseCoinbase () {
return this.currency === 'USD' && this.amount < 6
}
get userInAmerica () {
return !(this.props.ledgerData.exchangeName && this.props.ledgerData.exchangeURL)
}
get coinbasePanel () {
if (this.canUseCoinbase) {
return <div className='panel'>
Expand All @@ -311,6 +314,19 @@ class BitcoinDashboard extends ImmutableComponent {
</div>
}
}
get exchangePanel () {
return <div className='panel'>
<div className='settingsPanelDivider'>
<span className='fa fa-credit-card' />
<div className='settingsListTitle' data-l10n-id='outsideUSAPayment' />
</div>
<div className='settingsPanelDivider'>
<a className='browserButton primaryButton' href={this.props.ledgerData.exchangeURL}>
{this.props.ledgerData.exchangeURL}
</a>
</div>
</div>
}
get smartphonePanel () {
return <div className='panel'>
<div className='settingsPanelDivider'>
Expand Down Expand Up @@ -362,7 +378,10 @@ class BitcoinDashboard extends ImmutableComponent {
: null
}
<div className='board'>
{this.coinbasePanel}
{ (this.userInAmerica)
? this.coinbasePanel
: this.exchangePanel
}
<div className='panel'>
<div className='settingsPanelDivider'>
<span className='bitcoinIcon fa-stack fa-lg'>
Expand Down

0 comments on commit 403987e

Please sign in to comment.