Skip to content
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

Updating empty wallet messaging for unsupported regions (0.72) #3910

Merged
merged 1 commit into from
Nov 11, 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
2 changes: 2 additions & 0 deletions browser/ui/webui/brave_webui_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,13 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "rewardsOffText2", IDS_BRAVE_UI_REWARDS_OFF_TEXT2 },
{ "rewardsOffText3", IDS_BRAVE_UI_REWARDS_OFF_TEXT3 },
{ "rewardsOffText4", IDS_BRAVE_UI_REWARDS_OFF_TEXT4 },
{ "rewardsPanelEmptyTextPoints", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT_POINTS }, // NOLINT
{ "rewardsPanelEmptyText1", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT1 },
{ "rewardsPanelEmptyText2", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT2 },
{ "rewardsPanelEmptyText3", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT3 },
{ "rewardsPanelEmptyText4", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT4 },
{ "rewardsPanelEmptyText5", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT5 },
{ "rewardsPanelEmptyText6", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT6 },
{ "rewardsPanelOffText1", IDS_BRAVE_UI_REWARDS_PANEL_OFF_TEXT1 },
{ "rewardsPanelOffText2", IDS_BRAVE_UI_REWARDS_PANEL_OFF_TEXT2 },
{ "rewardsPanelText1", IDS_BRAVE_UI_REWARDS_PANEL_TEXT1 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ class PageWallet extends React.Component<Props, State> {
{
enabledMain
? emptyWallet
? <WalletEmpty />
? <WalletEmpty onlyAnonWallet={onlyAnonWallet} />
: <WalletSummary
reservedAmount={pendingTotal}
onlyAnonWallet={onlyAnonWallet}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,45 @@ import coins from './assets/coins'

interface Props {
id?: string
onlyAnonWallet?: boolean
hideAddFundsText?: boolean
}

export default class WalletEmpty extends React.PureComponent<Props, {}> {
getEmptyWalletMessage = () => {
const { onlyAnonWallet } = this.props
return (
<>
{
onlyAnonWallet
? getLocale('rewardsPanelEmptyText6')
: <>
<b>{getLocale('rewardsPanelEmptyText2')}</b><br/>
• {getLocale('rewardsPanelEmptyText3')}<br/>
• {getLocale('rewardsPanelEmptyText4')}<br/>
• {getLocale('rewardsPanelEmptyText5')}
</>
}
</>
)
}

render () {
const { id, hideAddFundsText } = this.props
const { id, hideAddFundsText, onlyAnonWallet } = this.props

return (
<StyledWrapper id={id}>
{coins}
<StyledTitle>{getLocale('rewardsPanelEmptyText1')}</StyledTitle>
<StyledTitle>
{onlyAnonWallet ? getLocale('rewardsPanelEmptyTextPoints') : getLocale('rewardsPanelEmptyText1')}
</StyledTitle>
<StyledContent>
{
hideAddFundsText
? <StyledCenter>
{getLocale('rewardsPanelEmptyText5')}
</StyledCenter>
: <>
<b>{getLocale('rewardsPanelEmptyText2')}</b><br/>
• {getLocale('rewardsPanelEmptyText3')}<br/>
• {getLocale('rewardsPanelEmptyText4')}<br/>
• {getLocale('rewardsPanelEmptyText5')}
</>
: this.getEmptyWalletMessage()
}
</StyledContent>
</StyledWrapper>
Expand Down
2 changes: 2 additions & 0 deletions components/resources/brave_components_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,13 @@
<message name="IDS_BRAVE_UI_REWARDS_OFF_TEXT3" desc="">Today, Brave welcomes you to the new internet.</message>
<message name="IDS_BRAVE_UI_REWARDS_OFF_TEXT4" desc="">One where your time is valued, your personal data is kept private, and you actually get paid for your attention.</message>
<message name="IDS_BRAVE_UI_REWARDS_OFF_TEXT5" desc="">With your old browser, you paid to browse the web by viewing ads with your valuable attention. You spent your valuable time downloading invasive ad technology that transmitted your valuable private data to advertisers — without your consent.</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT_POINTS" desc="">Sadly, no points yet.</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT1" desc="">Sadly, no tokens yet.</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT2" desc="">3 ways to fill your wallet:</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT3" desc="">You can add funds.</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT4" desc="">You can earn tokens from viewing ads.</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT5" desc="">Occasionally, you'll be offered free token grants from Brave. Be sure to keep an eye out for the alert!</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT6" desc="">Look for ad notifications as you continue to use Brave. Your BAT Points balance will increase with each ad you view.</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_OFF_TEXT1" desc="">Get Rewarded for Browsing!</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_OFF_TEXT2" desc="">Earn tokens for your attention to ads and pay it forward to support content creators you value!</message>
<message name="IDS_BRAVE_UI_REWARDS_PANEL_TEXT1" desc="">Add, withdraw and manage funds at</message>
Expand Down