Skip to content

Commit

Permalink
Merge pull request #3849 from brave/fix-6604
Browse files Browse the repository at this point in the history
Updating empty wallet message for unsupported regions
  • Loading branch information
ryanml committed Nov 7, 2019
1 parent d750b62 commit 8ee60ee
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
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 @@ -483,11 +483,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 @@ -483,11 +483,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

0 comments on commit 8ee60ee

Please sign in to comment.