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

Commit

Permalink
In payments status, show next contribution date
Browse files Browse the repository at this point in the history
Fix #3801

Auditors: @bradleyrichter @diracdeltas

Test Plan:
1. Open Brave to Preferences > Payments
2. Confirm the "status" column has "Next contribution: {date}" on the bottom
  • Loading branch information
ayumi committed Sep 9, 2016
1 parent 143214a commit 9f3e7b0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ accountBalanceConnectionError=error, can't retrieve data
accountBalanceLoading=loading...
monthlyBudget=monthly budget
status=status
statusNextReconcileDate=Next contribution: {{reconcileDate}}.
createWallet=create wallet
createWalletStatus=Click the Create Wallet button to get started.
creatingWallet=creating...
Expand Down
20 changes: 18 additions & 2 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,20 @@ class PaymentsTab extends ImmutableComponent {
</div>
}

get nextReconcileDate () {
// Show date only after the user has funded the wallet.
// Afterwards balance should always !== 0 due to exchange rate fluctuations.
const ledgerData = this.props.ledgerData
if (!ledgerData.get('reconcileStamp')) {
return null
}
const nextReconcileDate = formattedDateFromTimestamp(ledgerData.get('reconcileStamp'))
const l10nDataArgs = {
reconcileDate: nextReconcileDate
}
return <div className='nextReconcileDate' data-l10n-args={JSON.stringify(l10nDataArgs)} data-l10n-id='statusNextReconcileDate' />
}

btcToCurrencyString (btc) {
const balance = Number(btc || 0)
const currency = this.props.ledgerData.get('currency') || 'USD'
Expand Down Expand Up @@ -753,8 +767,10 @@ class PaymentsTab extends ImmutableComponent {
</SettingItem>
</SettingsList>
</td>
<td id='walletStatus' data-l10n-id={this.walletStatus.id}
data-l10n-args={this.walletStatus.args ? JSON.stringify(this.walletStatus.args) : null} />
<td>
<div id='walletStatus' data-l10n-id={this.walletStatus.id} data-l10n-args={this.walletStatus.args ? JSON.stringify(this.walletStatus.args) : null} />
{this.nextReconcileDate}
</td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 4 additions & 0 deletions less/about/preferences.less
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,10 @@ div.nextPaymentSubmission {
height: 30px;
line-height: 30px;
}
.nextReconcileDate {
font-size: 14px;
margin: 10px 0;
}
}

.sort {
Expand Down

0 comments on commit 9f3e7b0

Please sign in to comment.