1
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
4
5
5
import * as React from 'react'
6
6
@@ -9,6 +9,7 @@ import createWidget from '../widget/index'
9
9
import { StyledTitleTab } from '../widgetTitleTab'
10
10
11
11
import { LocaleContext } from '../../../../brave_rewards/resources/shared/lib/locale_context'
12
+ import { getProviderPayoutStatus } from '../../../../brave_rewards/resources/shared/lib/provider_payout_status'
12
13
import { WithThemeVariables } from '../../../../brave_rewards/resources/shared/components/with_theme_variables'
13
14
import { GrantInfo } from '../../../../brave_rewards/resources/shared/lib/grant_info'
14
15
import { OnboardingCompletedStore } from '../../../../brave_rewards/resources/shared/lib/onboarding_completed_store'
@@ -92,6 +93,11 @@ export const RewardsWidget = createWidget((props: RewardsProps) => {
92
93
const adsInfo = props . adsAccountStatement || null
93
94
const grantInfo = getVisibleGrant ( props . promotions || [ ] )
94
95
96
+ const externalWallet = externalWalletFromExtensionData ( props . externalWallet )
97
+ const walletProvider = externalWallet ? externalWallet . provider : ''
98
+ const providerPayoutStatus = getProviderPayoutStatus (
99
+ props . parameters . payoutStatus , walletProvider )
100
+
95
101
const onClaimGrant = ( ) => {
96
102
if ( grantInfo ) {
97
103
chrome . braveRewards . openBrowserActionUI (
@@ -108,8 +114,9 @@ export const RewardsWidget = createWidget((props: RewardsProps) => {
108
114
rewardsBalance = { props . balance . total }
109
115
exchangeCurrency = 'USD'
110
116
exchangeRate = { props . parameters . rate }
117
+ providerPayoutStatus = { providerPayoutStatus }
111
118
grantInfo = { grantInfo }
112
- externalWallet = { externalWalletFromExtensionData ( props . externalWallet ) }
119
+ externalWallet = { externalWallet }
113
120
nextPaymentDate = { adsInfo ? adsInfo . nextPaymentDate : 0 }
114
121
earningsThisMonth = { adsInfo ? adsInfo . earningsThisMonth : 0 }
115
122
earningsLastMonth = { adsInfo ? adsInfo . earningsLastMonth : 0 }
0 commit comments