Skip to content

Updating welcome page text for anon wallets (0.71) #3934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -344,6 +344,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 @@ -65,7 +65,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 @@ -349,6 +349,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