Skip to content

Commit

Permalink
Updating empty wallet message for unsupported regions
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanml committed Oct 31, 2019
1 parent 763fc7e commit 26ef510
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 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 @@ -511,6 +511,7 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "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,10 +9,29 @@ 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

Expand All @@ -26,12 +45,7 @@ export default class WalletEmpty extends React.PureComponent<Props, {}> {
? <StyledCenter>
{getLocale('rewardsPanelEmptyText5')}
</StyledCenter>
: <>
<b>{getLocale('rewardsPanelEmptyText2')}</b><br/>
{getLocale('rewardsPanelEmptyText3')}<br/>
{getLocale('rewardsPanelEmptyText4')}<br/>
{getLocale('rewardsPanelEmptyText5')}
</>
: this.getEmptyWalletMessage()
}
</StyledContent>
</StyledWrapper>
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 @@ -504,6 +504,7 @@
<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 26ef510

Please sign in to comment.