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

Commit ba55077

Browse files
committed
In payments status, show next contribution date
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
1 parent 143214a commit ba55077

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ accountBalanceConnectionError=error, can't retrieve data
2828
accountBalanceLoading=loading...
2929
monthlyBudget=monthly budget
3030
status=status
31+
statusNextReconcileDate=Next contribution: {{reconcileDate}}.
3132
createWallet=create wallet
3233
createWalletStatus=Click the Create Wallet button to get started.
3334
creatingWallet=creating...

js/about/preferences.js

+19-2
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,21 @@ class PaymentsTab extends ImmutableComponent {
686686
</div>
687687
}
688688

689+
get nextReconcileDate () {
690+
// Show date only after the user has funded the wallet.
691+
// Afterwards balance should always !== 0 due to exchange rate fluctuations.
692+
const ledgerData = this.props.ledgerData
693+
const balance = Number(ledgerData.get('balance') || 0)
694+
if (balance === 0 || !ledgerData.get('reconcileStamp')) {
695+
return null
696+
}
697+
const nextReconcileDate = formattedDateFromTimestamp(ledgerData.get('reconcileStamp'))
698+
const l10nDataArgs = {
699+
reconcileDate: nextReconcileDate
700+
}
701+
return <div className='nextReconcileDate' data-l10n-args={JSON.stringify(l10nDataArgs)} data-l10n-id='statusNextReconcileDate' />
702+
}
703+
689704
btcToCurrencyString (btc) {
690705
const balance = Number(btc || 0)
691706
const currency = this.props.ledgerData.get('currency') || 'USD'
@@ -753,8 +768,10 @@ class PaymentsTab extends ImmutableComponent {
753768
</SettingItem>
754769
</SettingsList>
755770
</td>
756-
<td id='walletStatus' data-l10n-id={this.walletStatus.id}
757-
data-l10n-args={this.walletStatus.args ? JSON.stringify(this.walletStatus.args) : null} />
771+
<td>
772+
<div id='walletStatus' data-l10n-id={this.walletStatus.id} data-l10n-args={this.walletStatus.args ? JSON.stringify(this.walletStatus.args) : null} />
773+
{this.nextReconcileDate}
774+
</td>
758775
</tr>
759776
</tbody>
760777
</table>

less/about/preferences.less

+4
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,10 @@ div.nextPaymentSubmission {
616616
height: 30px;
617617
line-height: 30px;
618618
}
619+
.nextReconcileDate {
620+
font-size: 14px;
621+
margin: 10px 0;
622+
}
619623
}
620624

621625
.sort {

0 commit comments

Comments
 (0)