diff --git a/browser/ui/webui/brave_webui_source.cc b/browser/ui/webui/brave_webui_source.cc index f583cca47c56..9dd72cfb5a60 100644 --- a/browser/ui/webui/brave_webui_source.cc +++ b/browser/ui/webui/brave_webui_source.cc @@ -497,6 +497,7 @@ void CustomizeWebUIHTMLSource(const std::string &name, { "grantFinishTokenUGP", IDS_BRAVE_UI_GRANT_FINISH_TOKEN_UGP }, { "grantFinishPointUGP", IDS_BRAVE_UI_GRANT_FINISH_POINT_UGP }, { "grants", IDS_BRAVE_UI_GRANTS }, + { "greetingsVerified", IDS_BRAVE_UI_GREETINGS_VERIFIED }, { "import", IDS_BRAVE_UI_IMPORT }, { "includeInAuto", IDS_BRAVE_UI_INCLUDE_IN_AUTO }, { "learnMore", IDS_BRAVE_UI_LEARN_MORE }, diff --git a/components/brave_rewards/resources/extension/brave_rewards/_locales/en_US/messages.json b/components/brave_rewards/resources/extension/brave_rewards/_locales/en_US/messages.json index 508fa463e5a7..205870a59bc0 100644 --- a/components/brave_rewards/resources/extension/brave_rewards/_locales/en_US/messages.json +++ b/components/brave_rewards/resources/extension/brave_rewards/_locales/en_US/messages.json @@ -588,5 +588,15 @@ "pointGrants": { "message": "Point Grants", "description": "BAT Points Grant Text" + }, + "greetingsVerified": { + "message": "Hello, $name$!", + "description": "Greetings for external wallet popup", + "placeholders": { + "name": { + "content": "$1", + "example": "John" + } + } } } diff --git a/components/brave_rewards/resources/extension/brave_rewards/background/api/locale_api.ts b/components/brave_rewards/resources/extension/brave_rewards/background/api/locale_api.ts index 570bc3ba6946..03e332551c7e 100644 --- a/components/brave_rewards/resources/extension/brave_rewards/background/api/locale_api.ts +++ b/components/brave_rewards/resources/extension/brave_rewards/background/api/locale_api.ts @@ -59,6 +59,7 @@ export const getUIMessages = (): Record => { 'grantGeneralErrorText', 'grantGeneralErrorTitle', 'grants', + 'greetingsVerified', 'includeInAuto', 'insufficientFunds', 'insufficientFundsNotification', diff --git a/components/brave_rewards/resources/extension/brave_rewards/components/app.tsx b/components/brave_rewards/resources/extension/brave_rewards/components/app.tsx index f7ff39f6a4d5..ff40dd253a9c 100644 --- a/components/brave_rewards/resources/extension/brave_rewards/components/app.tsx +++ b/components/brave_rewards/resources/extension/brave_rewards/components/app.tsx @@ -335,7 +335,7 @@ export class RewardsPanel extends React.Component { onVerifyClick={onVerifyClick} onDisconnectClick={this.onDisconnectClick} goToUphold={this.goToUphold} - userName={utils.getUserName(externalWallet)} + greetings={utils.getGreetings(externalWallet)} actions={this.getActions()} > { onVerifyClick={onVerifyClick} onDisconnectClick={this.onDisconnectClick} goToUphold={this.goToUphold} - userName={utils.getUserName(externalWallet)} + greetings={utils.getGreetings(externalWallet)} onlyAnonWallet={this.props.onlyAnonWallet} {...notification} > diff --git a/components/brave_rewards/resources/extension/brave_rewards/utils.ts b/components/brave_rewards/resources/extension/brave_rewards/utils.ts index 009931c95b75..cbaeb0868377 100644 --- a/components/brave_rewards/resources/extension/brave_rewards/utils.ts +++ b/components/brave_rewards/resources/extension/brave_rewards/utils.ts @@ -139,12 +139,12 @@ export const getWalletStatus = (externalWallet?: RewardsExtension.ExternalWallet } } -export const getUserName = (externalWallet?: RewardsExtension.ExternalWallet) => { - if (!externalWallet) { +export const getGreetings = (externalWallet?: RewardsExtension.ExternalWallet) => { + if (!externalWallet || !externalWallet.userName) { return '' } - return externalWallet.userName + return getMessage('greetingsVerified', [externalWallet.userName]) } export const handleUpholdLink = (link: string, externalWallet?: RewardsExtension.ExternalWallet) => { diff --git a/components/brave_rewards/resources/page/components/pageWallet.tsx b/components/brave_rewards/resources/page/components/pageWallet.tsx index 7b277532bc81..bb5783cf32c1 100644 --- a/components/brave_rewards/resources/page/components/pageWallet.tsx +++ b/components/brave_rewards/resources/page/components/pageWallet.tsx @@ -442,13 +442,13 @@ class PageWallet extends React.Component { window.open(externalWallet.accountUrl, '_self') } - getUserName = () => { + getGreetings = () => { const { externalWallet } = this.props.rewardsData - if (!externalWallet) { + if (!externalWallet || !externalWallet.userName) { return '' } - return externalWallet.userName + return getLocale('greetingsVerified', { name: externalWallet.userName }) } onDisconnectClick = () => { @@ -779,7 +779,7 @@ class PageWallet extends React.Component { onVerifyClick={onVerifyClick} onDisconnectClick={this.onDisconnectClick} goToUphold={this.goToUphold} - userName={this.getUserName()} + greetings={this.getGreetings()} onlyAnonWallet={onlyAnonWallet} > { diff --git a/components/brave_rewards/resources/ui/components/walletPopup/index.tsx b/components/brave_rewards/resources/ui/components/walletPopup/index.tsx index 1597fb0a4810..99e9832d7cbc 100644 --- a/components/brave_rewards/resources/ui/components/walletPopup/index.tsx +++ b/components/brave_rewards/resources/ui/components/walletPopup/index.tsx @@ -23,7 +23,7 @@ import { export interface Props { children: React.ReactNode onClose: () => void - userName: string + greetings: string id?: string verified?: boolean } @@ -38,7 +38,7 @@ export default class WalletPopup extends React.PureComponent { const { children, onClose, - userName, + greetings, id, verified } = this.props @@ -50,7 +50,7 @@ export default class WalletPopup extends React.PureComponent { - {userName} + {greetings} { verified ? diff --git a/components/brave_rewards/resources/ui/components/walletWrapper/index.tsx b/components/brave_rewards/resources/ui/components/walletWrapper/index.tsx index 1d35996a4ac9..e3c2e57c09c2 100644 --- a/components/brave_rewards/resources/ui/components/walletWrapper/index.tsx +++ b/components/brave_rewards/resources/ui/components/walletWrapper/index.tsx @@ -149,7 +149,7 @@ export interface Props { onVerifyClick?: () => void onDisconnectClick?: () => void goToUphold?: () => void - userName?: string + greetings?: string onlyAnonWallet?: boolean } @@ -402,14 +402,14 @@ export default class WalletWrapper extends React.PureComponent { } getVerificationDetails = () => { - const { goToUphold, userName, onDisconnectClick, onVerifyClick, walletState } = this.props + const { goToUphold, greetings, onDisconnectClick, onVerifyClick, walletState } = this.props const verified = walletState === 'verified' const connected = walletState === 'connected' return ( { diff --git a/components/resources/brave_components_strings.grd b/components/resources/brave_components_strings.grd index 7ad3c14bbb0e..9538f395215a 100644 --- a/components/resources/brave_components_strings.grd +++ b/components/resources/brave_components_strings.grd @@ -484,6 +484,7 @@ {{currency}} not used by the expiration date will be automatically returned to the Brave User Growth Pool. Grant Expiration Date Grants + Hello, {{name}}! import Include in Auto-Contribute Learn More diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_user.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_user.cc index 1abfcacaf7b3..ebb519156d37 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_user.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/uphold/uphold_user.cc @@ -92,7 +92,7 @@ void UpholdUser::OnGet( return; } - const auto* name = dictionary->FindStringKey("name"); + const auto* name = dictionary->FindStringKey("firstName"); if (name) { user.name = *name; }