Skip to content

Commit

Permalink
Merge pull request #17456 from brave/emerick-rewards-remove-note-from…
Browse files Browse the repository at this point in the history
…-reset-modal

Remove note from Reset Rewards modal
  • Loading branch information
emerick authored Mar 3, 2023
2 parents 5a84cbc + fdb3b2d commit d20ca37
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 51 deletions.
1 change: 0 additions & 1 deletion browser/ui/webui/brave_webui_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,6 @@ void CustomizeWebUIHTMLSource(content::WebUI* web_ui,
{ "rewardsResetConfirmation", IDS_BRAVE_UI_REWARDS_RESET_CONFIRMATION },
{ "rewardsResetConsent", IDS_BRAVE_UI_REWARDS_RESET_CONSENT },
{ "rewardsResetText", IDS_BRAVE_UI_REWARDS_RESET_TEXT },
{ "rewardsResetTextFunds", IDS_BRAVE_UI_REWARDS_RESET_TEXT_FUNDS },
{ "rewardsTokenGrantTitle", IDS_REWARDS_WIDGET_TOKEN_GRANT_TITLE },
{ "rewardsSummary", IDS_BRAVE_UI_REWARDS_SUMMARY },
{ "rewardsVBATNoticeText1", IDS_REWARDS_VBAT_NOTICE_TEXT1 },
Expand Down
17 changes: 0 additions & 17 deletions components/brave_rewards/browser/test/rewards_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,23 +287,6 @@ IN_PROC_BROWSER_TEST_F(RewardsBrowserTest, ResetRewards) {
"By resetting, your current Brave Rewards profile will be deleted");
}

IN_PROC_BROWSER_TEST_F(RewardsBrowserTest, ResetRewardsWithBAT) {
rewards_browsertest_util::CreateRewardsWallet(rewards_service_);
context_helper_->LoadRewardsPage();
contribution_->AddBalance(promotion_->ClaimPromotionViaCode());

rewards_browsertest_util::WaitForElementThenClick(
contents(), "[data-test-id=manage-wallet-button]");

rewards_browsertest_util::WaitForElementToAppear(
contents(),
"#modal");

rewards_browsertest_util::WaitForElementToContain(
contents(), "[data-test-id='funds-warning-text']",
"Note: You currently have 30 BAT estimated earnings this month");
}

IN_PROC_BROWSER_TEST_F(RewardsBrowserTest, EnableRewardsWithBalance) {
// Load a balance into the user's wallet
rewards_browsertest_util::CreateRewardsWallet(rewards_service_);
Expand Down
10 changes: 0 additions & 10 deletions components/brave_rewards/resources/page/components/pageWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,6 @@ class PageWallet extends React.Component<Props, State> {
)
}

getInternalFunds = () => {
const { balance } = this.props.rewardsData
if (!balance.wallets) {
return 0
}

return (balance.wallets.blinded || 0)
}

isWalletProviderEnabled = (walletProvider: string) => {
const { currentCountryCode, parameters } = this.props.rewardsData
const regions = parameters.walletProviderRegions[walletProvider] || null
Expand Down Expand Up @@ -589,7 +580,6 @@ class PageWallet extends React.Component<Props, State> {
? <ModalReset
onClose={this.onModalResetClose}
onReset={this.onModalResetOnReset}
internalFunds={this.getInternalFunds()}
/>
: null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface Props {
testId?: string
funds?: string
onReset: () => void
internalFunds: number
}

interface State {
Expand Down Expand Up @@ -106,33 +105,13 @@ export default class ModalReset extends React.PureComponent<Props, State> {
})
}

const getFundsWarningText = () => {
return formatMessage(getLocale('rewardsResetTextFunds'), {
placeholders: {
$1: (
<b key='amount'>
{this.props.internalFunds.toString()} BAT
</b>
)
}
})
}

return (
<>
<StyledTextWrapper>
<StyledText data-test-id={'reset-text'}>
{getResetText()}
</StyledText>
</StyledTextWrapper>
{
this.props.internalFunds > 0 &&
<StyledTextWrapper>
<StyledText data-test-id={'funds-warning-text'}>
{getFundsWarningText()}
</StyledText>
</StyledTextWrapper>
}
<Checkbox
value={{ resetConsent: this.state.resetConsent }}
onChange={onResetConsentChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('ModalReset tests', () => {
id='modal'
onClose={doNothing}
onReset={doNothing}
internalFunds={0}
{...props}
/>
</TestThemeProvider>
Expand Down
1 change: 0 additions & 1 deletion components/resources/brave_components_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,6 @@
<message name="IDS_BRAVE_UI_REWARDS_CONTRIBUTE_ATTENTION" desc="">Attention</message>
<message name="IDS_BRAVE_UI_REWARDS_RESET_CONFIRMATION" desc="">Are you sure you want to reset your Brave Rewards?</message>
<message name="IDS_BRAVE_UI_REWARDS_RESET_TEXT" desc="">By resetting, your current Brave Rewards profile will be deleted and you will start again with a completely new Brave Rewards profile. Before proceeding, <ph name="LINK_BEGIN">$1</ph>learn more<ph name="LINK_END">$2</ph> about resetting, just to be safe.</message>
<message name="IDS_BRAVE_UI_REWARDS_RESET_TEXT_FUNDS" desc="">Note: You currently have <ph name="BAT_AMOUNT">$1<ex>5 BAT</ex></ph> estimated earnings this month that will be lost if you reset now.</message>
<message name="IDS_BRAVE_UI_REWARDS_RESET_CONSENT" desc="">I understand that my current Brave Rewards profile and Brave Rewards data will be deleted from my device, and I've read the <ph name="LINK_BEGIN">$1</ph>support article about resetting<ph name="LINK_END">$2</ph>.</message>
<message name="IDS_BRAVE_UI_TOKEN_GRANT" desc="">Token Grants Claimed</message>
<message name="IDS_BRAVE_UI_REWARDS_SUMMARY" desc="">Rewards Summary</message>
Expand Down

0 comments on commit d20ca37

Please sign in to comment.