File tree 2 files changed +6
-38
lines changed
extension/brave_rewards/components
2 files changed +6
-38
lines changed Original file line number Diff line number Diff line change @@ -106,16 +106,11 @@ export class Panel extends React.Component<Props, State> {
106
106
const { rates } = walletProperties
107
107
const contributionMonthly = 10 // TODO NZ fix with new reports refactor https://github.com/brave/brave-core/pull/409
108
108
const convertedMonthly = utils . convertBalance ( contributionMonthly , rates )
109
- let total = contributionMonthly * - 1
110
109
111
110
let props = {
112
111
contribute : {
113
112
tokens : contributionMonthly ,
114
113
converted : convertedMonthly
115
- } ,
116
- total : {
117
- tokens : contributionMonthly ,
118
- converted : convertedMonthly
119
114
}
120
115
}
121
116
@@ -125,44 +120,33 @@ export class Panel extends React.Component<Props, State> {
125
120
tokens : report . ads ,
126
121
converted : utils . convertBalance ( report . ads , rates )
127
122
}
128
-
129
- total += report . ads
130
123
}
131
124
132
125
if ( report . donations ) {
133
126
props [ 'donation' ] = {
134
127
tokens : report . donations ,
135
128
converted : utils . convertBalance ( report . donations , rates )
136
129
}
137
-
138
- total -= report . donations
139
130
}
140
131
141
132
if ( report . grants ) {
142
133
props [ 'grant' ] = {
143
134
tokens : report . grants ,
144
135
converted : utils . convertBalance ( report . grants , rates )
145
136
}
146
-
147
- total += report . grants
148
137
}
149
138
150
139
if ( report . oneTime ) {
151
140
props [ 'tips' ] = {
152
141
tokens : report . oneTime ,
153
142
converted : utils . convertBalance ( report . oneTime , rates )
154
143
}
155
-
156
- total -= report . oneTime
157
- }
158
-
159
- props [ 'total' ] = {
160
- tokens : total ,
161
- converted : utils . convertBalance ( total , rates )
162
144
}
163
145
}
164
146
165
- return props
147
+ return {
148
+ report : props
149
+ }
166
150
}
167
151
168
152
openRewardsPage ( ) {
Original file line number Diff line number Diff line change @@ -180,16 +180,11 @@ class PageWallet extends React.Component<Props, State> {
180
180
const { contributionMonthly, walletInfo, reports } = this . props . rewardsData
181
181
const { rates } = walletInfo
182
182
const convertedMonthly = utils . convertBalance ( contributionMonthly , rates )
183
- let total = contributionMonthly * - 1
184
183
185
184
let props = {
186
185
contribute : {
187
186
tokens : contributionMonthly ,
188
187
converted : convertedMonthly
189
- } ,
190
- total : {
191
- tokens : contributionMonthly ,
192
- converted : convertedMonthly
193
188
}
194
189
}
195
190
@@ -202,44 +197,33 @@ class PageWallet extends React.Component<Props, State> {
202
197
tokens : report . ads ,
203
198
converted : utils . convertBalance ( report . ads , rates )
204
199
}
205
-
206
- total += report . ads
207
200
}
208
201
209
202
if ( report . donations ) {
210
203
props [ 'donation' ] = {
211
204
tokens : report . donations ,
212
205
converted : utils . convertBalance ( report . donations , rates )
213
206
}
214
-
215
- total -= report . donations
216
207
}
217
208
218
209
if ( report . grants ) {
219
210
props [ 'grant' ] = {
220
211
tokens : report . grants ,
221
212
converted : utils . convertBalance ( report . grants , rates )
222
213
}
223
-
224
- total += report . grants
225
214
}
226
215
227
216
if ( report . oneTime ) {
228
217
props [ 'tips' ] = {
229
218
tokens : report . oneTime ,
230
219
converted : utils . convertBalance ( report . oneTime , rates )
231
220
}
232
-
233
- total -= report . oneTime
234
- }
235
-
236
- props [ 'total' ] = {
237
- tokens : total ,
238
- converted : utils . convertBalance ( total , rates )
239
221
}
240
222
}
241
223
242
- return props
224
+ return {
225
+ report : props
226
+ }
243
227
}
244
228
245
229
render ( ) {
You can’t perform that action at this time.
0 commit comments