Skip to content

Commit

Permalink
Merge pull request #12806 from brave/sszaloki-21936-update-pending-text
Browse files Browse the repository at this point in the history
Update text for `PENDING` status.
  • Loading branch information
szilardszaloki authored Mar 31, 2022
2 parents a0c8e21 + ccc48fc commit 712a215
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 41 deletions.
3 changes: 1 addition & 2 deletions browser/ui/webui/brave_webui_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,6 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "walletAccountLink", IDS_REWARDS_WALLET_ACCOUNT_LINK },
{ "walletAddFunds", IDS_REWARDS_WALLET_ADD_FUNDS },
{ "walletAutoContribute", IDS_REWARDS_WALLET_AUTO_CONTRIBUTE },
{ "walletCompleteVerificationLink", IDS_REWARDS_WALLET_COMPLETE_VERIFICATION_LINK }, // NOLINT
{ "walletCompleteVerificationText", IDS_REWARDS_WALLET_COMPLETE_VERIFICATION_TEXT }, // NOLINT
{ "walletDisconnected", IDS_REWARDS_WALLET_DISCONNECTED },
{ "walletDisconnectLink", IDS_REWARDS_WALLET_DISCONNECT_LINK },
{ "walletEstimatedEarnings", IDS_REWARDS_WALLET_ESTIMATED_EARNINGS },
Expand All @@ -786,6 +784,7 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "walletOneTimeTips", IDS_REWARDS_WALLET_ONE_TIME_TIPS },
{ "walletPending", IDS_REWARDS_WALLET_PENDING },
{ "walletPendingContributions", IDS_REWARDS_WALLET_PENDING_CONTRIBUTIONS }, // NOLINT
{ "walletPendingText", IDS_REWARDS_WALLET_PENDING_TEXT },
{ "walletRewardsFromAds", IDS_REWARDS_WALLET_REWARDS_FROM_ADS },
{ "walletRewardsSummary", IDS_REWARDS_WALLET_REWARDS_SUMMARY },
{ "walletUnverified", IDS_REWARDS_WALLET_UNVERIFIED },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,6 @@
"message": "Auto-Contribute",
"description": ""
},
"walletCompleteVerificationLink": {
"message": "Go to $provider$ to complete verification",
"description": "",
"placeholders": {
"provider": {
"content": "$1"
}
}
},
"walletCompleteVerificationText": {
"message": "Please complete identity verification in order to start receiving rewards.",
"description": ""
},
"walletDisconnected": {
"message": "Logged out",
"description": ""
Expand Down Expand Up @@ -243,6 +230,15 @@
"message": "Pending",
"description": ""
},
"walletPendingText": {
"message": "There is a temporary problem verifying with $provider$. Your Brave Rewards will remain in a Pending state and retry automatically, but you can also try again later.",
"description": "",
"placeholders": {
"provider": {
"content": "$1"
}
}
},
"walletRewardsFromAds": {
"message": "Rewards from Ads",
"description": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,6 @@ export function ExternalWalletBubble (props: Props) {

function renderAccountLink () {
switch (externalWallet.status) {
case 'pending':
return (
<button onClick={actionHandler('complete-verification')}>
{
formatMessage(getString('walletCompleteVerificationLink'), [
providerName
])
}
</button>
)
case 'disconnected':
return (
<button onClick={actionHandler('reconnect')}>
Expand All @@ -68,6 +58,8 @@ export function ExternalWalletBubble (props: Props) {
}
</button>
)
case 'pending':
return null
case 'verified':
return (
<button onClick={actionHandler('view-account')}>
Expand All @@ -94,16 +86,21 @@ export function ExternalWalletBubble (props: Props) {
</style.header>
{
externalWallet.status === 'pending' &&
<style.pendingNotice>
<PendingIcon />
<span>{getString('walletCompleteVerificationText')}</span>
</style.pendingNotice>
<style.pendingNotice>
<PendingIcon />
<span>
{formatMessage(getString('walletPendingText'), [providerName])}
</span>
</style.pendingNotice>
}
<style.links>
<style.link>
<style.linkMarker />
{renderAccountLink()}
</style.link>
{
externalWallet.status !== 'pending' &&
<style.link>
<style.linkMarker />
{renderAccountLink()}
</style.link>
}
<style.link>
<style.linkMarker />
<button onClick={actionHandler('disconnect')}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export const localeStrings = {
walletAccountLink: 'Go to your $1 account',
walletAddFunds: 'Add Funds',
walletAutoContribute: 'Auto-Contribute',
walletCompleteVerificationLink: 'Go to $1 to complete verification',
walletCompleteVerificationText: 'Please complete identity verification in order to start receiving rewards.',
walletDisconnected: 'Logged out',
walletDisconnectLink: 'Disconnect from $1',
walletEstimatedEarnings: 'Estimated Earnings',
Expand All @@ -16,6 +14,7 @@ export const localeStrings = {
walletOneTimeTips: 'One-Time Tips',
walletPending: 'Pending',
walletPendingContributions: 'Pending contributions',
walletPendingText: 'There is a temporary problem verifying with $1. Your Brave Rewards will remain in a Pending state and retry automatically, but you can also try again later.',
walletRewardsFromAds: 'Rewards from Ads',
walletRewardsSummary: 'Rewards Summary',
walletUnverified: 'Unverified',
Expand Down
9 changes: 3 additions & 6 deletions components/resources/rewards_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
<message name="IDS_REWARDS_WALLET_AUTO_CONTRIBUTE" desc="">
Auto-Contribute
</message>
<message name="IDS_REWARDS_WALLET_COMPLETE_VERIFICATION_LINK" desc="">
Go to <ph name="PROVIDER">$1<ex>Uphold</ex></ph> to complete verification
</message>
<message name="IDS_REWARDS_WALLET_COMPLETE_VERIFICATION_TEXT" desc="">
Please complete identity verification in order to start receiving rewards.
</message>
<message name="IDS_REWARDS_WALLET_DISCONNECTED" desc="">
Logged out
</message>
Expand All @@ -52,6 +46,9 @@
<message name="IDS_REWARDS_WALLET_PENDING_CONTRIBUTIONS" desc="">
Pending contributions
</message>
<message name="IDS_REWARDS_WALLET_PENDING_TEXT" desc="">
There is a temporary problem verifying with <ph name="PROVIDER">$1<ex>Uphold</ex></ph>. Your Brave Rewards will remain in a Pending state and retry automatically, but you can also try again later.
</message>
<message name="IDS_REWARDS_WALLET_REWARDS_FROM_ADS" desc="">
Rewards from Ads
</message>
Expand Down

0 comments on commit 712a215

Please sign in to comment.