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

In payments status, show next contribution date #3833

Merged
merged 1 commit into from
Sep 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 16 additions & 2 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,18 @@ class PaymentsTab extends ImmutableComponent {
</div>
}

get nextReconcileDate () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should return null if ledgerData.get('reconcileStamp') is not a number (may be undefined/null)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think I check for this on line 694 – is that right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops i missed that, sorry

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' />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we generally prefer const over let for declaring variables that aren't going to be reassigned

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx good idea – fixed it

}

btcToCurrencyString (btc) {
const balance = Number(btc || 0)
const currency = this.props.ledgerData.get('currency') || 'USD'
Expand Down Expand Up @@ -753,8 +765,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