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

Commit

Permalink
Initial check-in
Browse files Browse the repository at this point in the history
Rework of #6766
  • Loading branch information
mrose17 committed Jan 24, 2017
1 parent 46ff336 commit 58cad16
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
7 changes: 5 additions & 2 deletions app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ monthlyBudget=monthly budget
status=status
statusOnError=Brave Wallet can't be reached.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
statusNextReconcileToday=Contribution due date is today.
createWallet=create wallet
createWalletStatus=Click the Create Wallet button to get started.
creatingWallet=creating…
Expand All @@ -48,10 +49,12 @@ bitcoin=Bitcoin
bitcoinAdd=Use your existing Bitcoin wallet/account
bitcoinAddDescription=Use any BTC wallet that can transfer Bitcoin to your Brave wallet.
bitcoinBuy=Buy Bitcoin
noPaymentHistory=Your first payment contribution will be {{reconcileDate}}
noPaymentHistory=Your first contribution will be {{reconcileDate}}
viewPaymentHistory=View Payment History…
paymentHistoryTitle=Your Payment History
paymentHistoryFooterText=Your next payment contribution is {{reconcileDate}}.
paymentHistoryFooterText=Your next contribution is {{reconcileDate}}.
paymentHistoryDueFooterText=Your next contribution is due.
paymentHistoryOverdueFooterText=Your next contribution is overdue.
paymentHistoryOKText=OK
hideExcluded=Only show included sites
bravePayments=Brave Payments
Expand Down
20 changes: 18 additions & 2 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -1033,13 +1033,20 @@ class PaymentsTab extends ImmutableComponent {
return null
}
const timestamp = ledgerData.get('reconcileStamp')
const now = new Date().getTime()
let l10nDataId = 'paymentHistoryFooterText'
if (timestamp <= now) {
l10nDataId = (timestamp <= (now - (24 * 60 * 60 * 1000)))
? 'paymentHistoryOverdueFooterText' : 'paymentHistoryDueFooterText'
}

const nextReconcileDateRelative = formattedTimeFromNow(timestamp)
const l10nDataArgs = {
reconcileDate: nextReconcileDateRelative
}
return <div className='paymentHistoryFooter'>
<div className='nextPaymentSubmission'>
<span data-l10n-id='paymentHistoryFooterText' data-l10n-args={JSON.stringify(l10nDataArgs)} />
<span data-l10n-id={l10nDataId} data-l10n-args={JSON.stringify(l10nDataArgs)} />
</div>
<Button l10nId='paymentHistoryOKText' className='okButton primaryButton' onClick={this.props.hideOverlay.bind(this, 'paymentHistory')} />
</div>
Expand Down Expand Up @@ -1203,15 +1210,24 @@ class PaymentsTab extends ImmutableComponent {
}

get nextReconcileMessage () {
const ledgerData = this.props.ledgerData
const nextReconcileDateRelative = this.nextReconcileDate
if (!nextReconcileDateRelative) {
return null
}

const timestamp = ledgerData.get('reconcileStamp')
const now = new Date().getTime()
let l10nDataId = 'statusNextReconcileDate'
if (timestamp <= now) {
l10nDataId = (timestamp <= (now - (24 * 60 * 60 * 1000)))
? 'paymentHistoryOverdueFooterText' : 'statusNextReconcileToday'
}

const l10nDataArgs = {
reconcileDate: nextReconcileDateRelative
}
return <div className='nextReconcileDate' data-l10n-args={JSON.stringify(l10nDataArgs)} data-l10n-id='statusNextReconcileDate' />
return <div className='nextReconcileDate' data-l10n-args={JSON.stringify(l10nDataArgs)} data-l10n-id={l10nDataId} />
}

get ledgerDataErrorText () {
Expand Down

0 comments on commit 58cad16

Please sign in to comment.