From c2e4c06e186e47792d7dd97549213d555559b2ca Mon Sep 17 00:00:00 2001 From: brave-builds Date: Tue, 27 Oct 2020 16:48:07 +0000 Subject: [PATCH] Uplift of #6951 (squashed) to beta --- browser/ui/webui/brave_webui_source.cc | 3 ++ .../{uphold_bg.png => uphold_card_bg.png} | Bin .../page/promos/assets/uphold_equities_bg.svg | 1 + .../resources/page/promos/index.tsx | 30 ++++++++++++++---- .../resources/brave_components_strings.grd | 3 ++ 5 files changed, 31 insertions(+), 6 deletions(-) rename components/brave_rewards/resources/page/promos/assets/{uphold_bg.png => uphold_card_bg.png} (100%) create mode 100644 components/brave_rewards/resources/page/promos/assets/uphold_equities_bg.svg diff --git a/browser/ui/webui/brave_webui_source.cc b/browser/ui/webui/brave_webui_source.cc index a982ca2097c0..a676b62c632a 100644 --- a/browser/ui/webui/brave_webui_source.cc +++ b/browser/ui/webui/brave_webui_source.cc @@ -796,6 +796,9 @@ void CustomizeWebUIHTMLSource(const std::string &name, { "upholdPromoTitle", IDS_BRAVE_UI_UPHOLD_PROMO_TITLE }, { "upholdPromoInfo", IDS_BRAVE_UI_UPHOLD_PROMO_INFO }, + + { "upholdPromoEquitiesTitle", IDS_BRAVE_UI_UPHOLD_PROMO_EQUITIES_TITLE }, // NOLINT + { "upholdPromoEquitiesInfo", IDS_BRAVE_UI_UPHOLD_PROMO_EQUITIES_INFO }, } }, { std::string("adblock"), { diff --git a/components/brave_rewards/resources/page/promos/assets/uphold_bg.png b/components/brave_rewards/resources/page/promos/assets/uphold_card_bg.png similarity index 100% rename from components/brave_rewards/resources/page/promos/assets/uphold_bg.png rename to components/brave_rewards/resources/page/promos/assets/uphold_card_bg.png diff --git a/components/brave_rewards/resources/page/promos/assets/uphold_equities_bg.svg b/components/brave_rewards/resources/page/promos/assets/uphold_equities_bg.svg new file mode 100644 index 000000000000..4f63d1878c16 --- /dev/null +++ b/components/brave_rewards/resources/page/promos/assets/uphold_equities_bg.svg @@ -0,0 +1 @@ + diff --git a/components/brave_rewards/resources/page/promos/index.tsx b/components/brave_rewards/resources/page/promos/index.tsx index fd304813140f..6a95eddd2f93 100644 --- a/components/brave_rewards/resources/page/promos/index.tsx +++ b/components/brave_rewards/resources/page/promos/index.tsx @@ -4,11 +4,12 @@ import * as React from 'react' import tapBg from './assets/tap_bg.svg' -import upholdBg from './assets/uphold_bg.png' +import upholdCardBg from './assets/uphold_card_bg.png' +import upholdEquitiesBg from './assets/uphold_equities_bg.svg' import { StyledInfo } from '../../ui/components/sidebarPromo/style' import { getLocale } from '../../../../common/locale' -export type PromoType = 'uphold' | 'tap-network' +export type PromoType = 'uphold-card' | 'tap-network' | 'uphold-equities' export interface Promo { title: string @@ -25,10 +26,12 @@ export const getActivePromos = (rewardsData: Rewards.State) => { if (rewardsData) { let wallet = rewardsData.externalWallet if (wallet && wallet.status === 2 && wallet.address && wallet.address.length > 0) { // WalletStatus::VERIFIED - promos.unshift('uphold') + promos.unshift('uphold-card') } } + promos.unshift('uphold-equities') + return promos } @@ -37,9 +40,12 @@ const getLink = (type: PromoType) => { case 'tap-network': { return 'https://brave.tapnetwork.io' } - case 'uphold': { + case 'uphold-card': { return 'https://uphold.com/brave/upholdcard' } + case 'uphold-equities': { + return 'https://uphold.com/en/buy-fractional-shares/brave' + } } return '' @@ -60,9 +66,9 @@ export const getPromo = (type: PromoType, rewardsData: Rewards.State) => { title: getLocale('tapNetworkTitle'), disclaimer: getLocale('tapNetworkDisclaimer') } - case 'uphold': + case 'uphold-card': return { - imagePath: upholdBg, + imagePath: upholdCardBg, link: getLink(type), copy: ( @@ -72,6 +78,18 @@ export const getPromo = (type: PromoType, rewardsData: Rewards.State) => { supportedLocales: ['US'], title: getLocale('upholdPromoTitle') } + case 'uphold-equities': + return { + imagePath: upholdEquitiesBg, + link: getLink(type), + copy: ( + + {getLocale('upholdPromoEquitiesInfo')} + + ), + supportedLocales: ['US'], + title: getLocale('upholdPromoEquitiesTitle') + } default: return null } diff --git a/components/resources/brave_components_strings.grd b/components/resources/brave_components_strings.grd index daeb05d7c46a..dbeef6ddd1a9 100644 --- a/components/resources/brave_components_strings.grd +++ b/components/resources/brave_components_strings.grd @@ -817,6 +817,9 @@ Get 2% cryptoback with the Uphold card Spend your crypto and other assets at nearly 50 million merchants and ATMs worldwide. Spend crypto to get crypto! + U.S. equities trading available on Uphold + Invest as little as $1 in popular stocks and exchange traded funds such as AAPL, TSLA or AMZN + $1Learn more$2 about Brave Rewards