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,12 @@ 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 : null
98
+ const providerPayoutStatus = props . parameters . payoutStatus
99
+ ? getProviderPayoutStatus ( props . parameters . payoutStatus , walletProvider )
100
+ : 'off'
101
+
95
102
const onClaimGrant = ( ) => {
96
103
if ( grantInfo ) {
97
104
chrome . braveRewards . showGrantCaptcha ( grantInfo . id )
@@ -107,8 +114,9 @@ export const RewardsWidget = createWidget((props: RewardsProps) => {
107
114
rewardsBalance = { props . balance . total }
108
115
exchangeCurrency = 'USD'
109
116
exchangeRate = { props . parameters . rate }
117
+ providerPayoutStatus = { providerPayoutStatus }
110
118
grantInfo = { grantInfo }
111
- externalWallet = { externalWalletFromExtensionData ( props . externalWallet ) }
119
+ externalWallet = { externalWallet }
112
120
nextPaymentDate = { adsInfo ? adsInfo . nextPaymentDate : 0 }
113
121
earningsThisMonth = { adsInfo ? adsInfo . earningsThisMonth : 0 }
114
122
earningsLastMonth = { adsInfo ? adsInfo . earningsLastMonth : 0 }
0 commit comments