Skip to content

Commit beedc0f

Browse files
authored
Merge pull request #3934 from brave/uplift-3897-71
Updating welcome page text for anon wallets (0.71)
2 parents 44d4ee6 + 52a52aa commit beedc0f

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

browser/ui/webui/brave_webui_source.cc

+1
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ void CustomizeWebUIHTMLSource(const std::string &name,
344344
{ "amount", IDS_BRAVE_UI_AMOUNT },
345345
{ "backup", IDS_BRAVE_UI_BACKUP },
346346
{ "braveAdsDesc", IDS_BRAVE_UI_BRAVE_ADS_DESC },
347+
{ "braveAdsDescPoints", IDS_BRAVE_UI_BRAVE_ADS_DESC_POINTS },
347348
{ "braveAdsLaunchMsg", IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_MSG },
348349
{ "braveAdsLaunchTitle", IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_TITLE },
349350
{ "braveAdsTitle", IDS_BRAVE_UI_BRAVE_ADS_TITLE },

components/brave_rewards/resources/page/components/app.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class App extends React.Component<Props, State> {
4141
this.props.actions.onAdsSettingSave('adsEnabledMigrated', adsEnabled)
4242
}
4343
}
44+
this.props.actions.onlyAnonWallet()
4445
}
4546

4647
componentDidUpdate (prevProps: Props, prevState: State) {
@@ -75,7 +76,8 @@ export class App extends React.Component<Props, State> {
7576
}
7677

7778
render () {
78-
const { walletCreated, walletCreateFailed } = this.props.rewardsData
79+
const { walletCreated, walletCreateFailed, ui } = this.props.rewardsData
80+
const { onlyAnonWallet } = ui
7981

8082
let props: {onReTry?: () => void} = {}
8183

@@ -91,6 +93,7 @@ export class App extends React.Component<Props, State> {
9193
!walletCreated
9294
? <WelcomePage
9395
onTOSClick={this.openTOS}
96+
onlyAnonWallet={onlyAnonWallet}
9497
onPrivacyClick={this.openPrivacyPolicy}
9598
optInAction={this.onCreateWalletClicked}
9699
creating={this.state.creating}

components/brave_rewards/resources/page/components/settingsPage.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class SettingsPage extends React.Component<Props, State> {
6565
this.actions.onSettingSave('firstLoad', false)
6666
}
6767

68-
this.actions.onlyAnonWallet()
6968
this.actions.getWalletProperties()
7069
this.actions.getBalance()
7170
this.balanceTimerId = setInterval(() => {

components/brave_rewards/resources/ui/components/welcomePage/index.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export interface Props {
5656
id?: string
5757
optInAction: () => void
5858
creating?: boolean
59+
onlyAnonWallet?: boolean
5960
onReTry?: () => void
6061
onTOSClick?: () => void
6162
onPrivacyClick?: () => void
@@ -212,7 +213,8 @@ class WelcomePage extends React.PureComponent<Props, {}> {
212213
)
213214
}
214215

215-
get infoCards (): CardProps[] {
216+
infoCards = (): CardProps[] => {
217+
const { onlyAnonWallet } = this.props
216218
return [
217219
{
218220
title: getLocale('turnOnRewardsTitle'),
@@ -221,7 +223,7 @@ class WelcomePage extends React.PureComponent<Props, {}> {
221223
},
222224
{
223225
title: getLocale('braveAdsTitle'),
224-
description: getLocale('braveAdsDesc'),
226+
description: onlyAnonWallet ? getLocale('braveAdsDescPoints') : getLocale('braveAdsDesc'),
225227
icon: <AdsMegaphoneIcon />
226228
},
227229
{
@@ -265,7 +267,7 @@ class WelcomePage extends React.PureComponent<Props, {}> {
265267
<StyledInfoContent>
266268
<InfoCard
267269
id='rewards-info'
268-
cards={this.infoCards}
270+
cards={this.infoCards()}
269271
/>
270272
</StyledInfoContent>
271273
<StyledTakeActionContent>

components/resources/brave_components_strings.grd

+1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@
349349
<message name="IDS_BRAVE_UI_AMOUNT" desc="">Amount</message>
350350
<message name="IDS_BRAVE_UI_BACKUP" desc="">Backup</message>
351351
<message name="IDS_BRAVE_UI_BRAVE_ADS_DESC" desc="">Get paid to view relevant ads that respect your privacy.</message>
352+
<message name="IDS_BRAVE_UI_BRAVE_ADS_DESC_POINTS" desc="">Collect points when you view relevant ads that respect your privacy.</message>
352353
<message name="IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_MSG" desc="">Now you can earn by viewing ads.</message>
353354
<message name="IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_TITLE" desc="">Brave Ads has arrived!</message>
354355
<message name="IDS_BRAVE_UI_BRAVE_ADS_TITLE" desc="">Ads</message>

components/test/brave_rewards/page/components/app_test.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ describe('rewardsPage component', () => {
4747
const wrapper = shallow(
4848
<App
4949
actions={{
50-
checkWalletExistence: () => false
50+
checkWalletExistence: () => false,
51+
onlyAnonWallet: () => false
5152
}}
5253
rewardsData={rewardsInitialState.rewardsData as Rewards.State}
5354
/>

0 commit comments

Comments
 (0)