Skip to content

Commit

Permalink
Merge pull request #3933 from brave/uplift-3897-72
Browse files Browse the repository at this point in the history
Updating welcome page text for anon wallets (0.72)
  • Loading branch information
kjozwiak committed Nov 10, 2019
2 parents 7ce7ee2 + 0dbfbf5 commit 39d5bbe
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions browser/ui/webui/brave_webui_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "amount", IDS_BRAVE_UI_AMOUNT },
{ "backup", IDS_BRAVE_UI_BACKUP },
{ "braveAdsDesc", IDS_BRAVE_UI_BRAVE_ADS_DESC },
{ "braveAdsDescPoints", IDS_BRAVE_UI_BRAVE_ADS_DESC_POINTS },
{ "braveAdsLaunchMsg", IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_MSG },
{ "braveAdsLaunchTitle", IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_TITLE },
{ "braveAdsTitle", IDS_BRAVE_UI_BRAVE_ADS_TITLE },
Expand Down
5 changes: 4 additions & 1 deletion components/brave_rewards/resources/page/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class App extends React.Component<Props, State> {
this.props.actions.onAdsSettingSave('adsEnabledMigrated', adsEnabled)
}
}
this.props.actions.onlyAnonWallet()
}

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

render () {
const { walletCreated, walletCreateFailed } = this.props.rewardsData
const { walletCreated, walletCreateFailed, ui } = this.props.rewardsData
const { onlyAnonWallet } = ui

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

Expand All @@ -91,6 +93,7 @@ export class App extends React.Component<Props, State> {
!walletCreated
? <WelcomePage
onTOSClick={this.openTOS}
onlyAnonWallet={onlyAnonWallet}
onPrivacyClick={this.openPrivacyPolicy}
optInAction={this.onCreateWalletClicked}
creating={this.state.creating}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class SettingsPage extends React.Component<Props, State> {
this.actions.onSettingSave('firstLoad', false)
}

this.actions.onlyAnonWallet()
this.actions.getWalletProperties()
this.actions.getBalance()
this.balanceTimerId = setInterval(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface Props {
id?: string
optInAction: () => void
creating?: boolean
onlyAnonWallet?: boolean
onReTry?: () => void
onTOSClick?: () => void
onPrivacyClick?: () => void
Expand Down Expand Up @@ -212,7 +213,8 @@ class WelcomePage extends React.PureComponent<Props, {}> {
)
}

get infoCards (): CardProps[] {
infoCards = (): CardProps[] => {
const { onlyAnonWallet } = this.props
return [
{
title: getLocale('turnOnRewardsTitle'),
Expand All @@ -221,7 +223,7 @@ class WelcomePage extends React.PureComponent<Props, {}> {
},
{
title: getLocale('braveAdsTitle'),
description: getLocale('braveAdsDesc'),
description: onlyAnonWallet ? getLocale('braveAdsDescPoints') : getLocale('braveAdsDesc'),
icon: <AdsMegaphoneIcon />
},
{
Expand Down Expand Up @@ -265,7 +267,7 @@ class WelcomePage extends React.PureComponent<Props, {}> {
<StyledInfoContent>
<InfoCard
id='rewards-info'
cards={this.infoCards}
cards={this.infoCards()}
/>
</StyledInfoContent>
<StyledTakeActionContent>
Expand Down
1 change: 1 addition & 0 deletions components/resources/brave_components_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@
<message name="IDS_BRAVE_UI_AMOUNT" desc="">Amount</message>
<message name="IDS_BRAVE_UI_BACKUP" desc="">Backup</message>
<message name="IDS_BRAVE_UI_BRAVE_ADS_DESC" desc="">Get paid to view relevant ads that respect your privacy.</message>
<message name="IDS_BRAVE_UI_BRAVE_ADS_DESC_POINTS" desc="">Collect points when you view relevant ads that respect your privacy.</message>
<message name="IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_MSG" desc="">Now you can earn by viewing ads.</message>
<message name="IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_TITLE" desc="">Brave Ads has arrived!</message>
<message name="IDS_BRAVE_UI_BRAVE_ADS_TITLE" desc="">Ads</message>
Expand Down
3 changes: 2 additions & 1 deletion components/test/brave_rewards/page/components/app_test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ describe('rewardsPage component', () => {
const wrapper = shallow(
<App
actions={{
checkWalletExistence: () => false
checkWalletExistence: () => false,
onlyAnonWallet: () => false
}}
rewardsData={rewardsInitialState.rewardsData as Rewards.State}
/>
Expand Down

0 comments on commit 39d5bbe

Please sign in to comment.