Skip to content

Commit

Permalink
Uplift of #5066 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-browser-releases committed Mar 31, 2020
1 parent e3c9166 commit 1b6f6fd
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 27 deletions.
2 changes: 1 addition & 1 deletion components/brave_new_tab_ui/rewards-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export const getTotalContributions = (report: NewTab.RewardsBalanceReport) => {
return 0.0
}

return report.tips + report.contribute + report.donation
return report.tips + report.contribute + report.monthly
}
11 changes: 0 additions & 11 deletions components/brave_rewards/resources/android_page/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

import BigNumber from 'bignumber.js'

export let actions: any = null

export const getActions = () => actions
Expand Down Expand Up @@ -40,15 +38,6 @@ export const generateContributionMonthly = (list: number[], rates: Record<string
})
}

export const tipsTotal = (report: Rewards.BalanceReport) => {
if (!report) {
return '0.0'
}

const tips = new BigNumber(report.tips)
return new BigNumber(report.donation).plus(tips).dividedBy('1e18').toFixed(1, BigNumber.ROUND_DOWN)
}

export const tipsListTotal = (list: Rewards.Publisher[]) => {
if (list.length === 0) {
return 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const defaultState: RewardsExtension.State = {
balanceReport: {
ads: 0.0,
contribute: 0.0,
donation: 0.0,
monthly: 0.0,
grant: 0.0,
tips: 0.0
},
Expand Down
11 changes: 0 additions & 11 deletions components/brave_rewards/resources/page/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

import BigNumber from 'bignumber.js'

export let actions: any = null

export const getActions = () => actions
Expand Down Expand Up @@ -40,15 +38,6 @@ export const generateContributionMonthly = (list: number[], rates: Record<string
})
}

export const tipsTotal = (report: Rewards.BalanceReport) => {
if (!report) {
return '0.0'
}

const tips = new BigNumber(report.tips)
return new BigNumber(report.donation).plus(tips).dividedBy('1e18').toFixed(1, BigNumber.ROUND_DOWN)
}

export const tipsListTotal = (list: Rewards.Publisher[]) => {
if (list.length === 0) {
return 0.0
Expand Down
2 changes: 1 addition & 1 deletion components/definitions/newTab.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ declare namespace NewTab {
export interface RewardsBalanceReport {
ads: number
contribute: number
donation: number
monthly: number
grant: number
tips: number
}
Expand Down
2 changes: 1 addition & 1 deletion components/definitions/rewards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ declare namespace Rewards {
export interface BalanceReport {
ads: number
contribute: number
donation: number
monthly: number
grant: number
tips: number
}
Expand Down
2 changes: 1 addition & 1 deletion components/definitions/rewardsExtensions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ declare namespace RewardsExtension {
export interface BalanceReport {
ads: number
contribute: number
donation: number
monthly: number
grant: number
tips: number
}
Expand Down

0 comments on commit 1b6f6fd

Please sign in to comment.