Skip to content

Commit

Permalink
Merge pull request #6961 from brave/pr6951_uphold-equities_1.17.x
Browse files Browse the repository at this point in the history
Adds uphold equities card (uplift to 1.17.x)
  • Loading branch information
kjozwiak authored Oct 30, 2020
2 parents c589c28 + 513b8a7 commit d13badb
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
3 changes: 3 additions & 0 deletions browser/ui/webui/brave_webui_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"), {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 34 additions & 6 deletions components/brave_rewards/resources/page/promos/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand All @@ -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 ''
Expand All @@ -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: (
<StyledInfo>
Expand All @@ -72,6 +78,28 @@ export const getPromo = (type: PromoType, rewardsData: Rewards.State) => {
supportedLocales: ['US'],
title: getLocale('upholdPromoTitle')
}
case 'uphold-equities':
return {
imagePath: upholdEquitiesBg,
link: getLink(type),
copy: (
<StyledInfo>
{getLocale('upholdPromoEquitiesInfo')}
</StyledInfo>
),
supportedLocales: [
'AF', 'AG', 'AI', 'AN', 'AO', 'AR', 'AW', 'AZ', 'BB', 'BD', 'BF', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO',
'BR', 'BS', 'BT', 'BW', 'BZ', 'CF', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CV', 'DJ', 'DM', 'DO', 'DZ',
'EC', 'EH', 'ER', 'ET', 'FJ', 'FK', 'FM', 'GA', 'GD', 'GE', 'GH', 'GM', 'GN', 'GQ', 'GS', 'GT', 'GW', 'GY',
'HK', 'HN', 'HT', 'ID', 'IN', 'IO', 'JM', 'JO', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KR', 'KW', 'KY', 'KZ',
'LA', 'LB', 'LC', 'LK', 'LR', 'LS', 'LY', 'MA', 'MG', 'MH', 'ML', 'MN', 'MO', 'MR', 'MS', 'MU', 'MV', 'MW',
'MZ', 'NA', 'NE', 'NG', 'NI', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PG', 'PH', 'PK', 'PN', 'PS', 'PW',
'PY', 'QA', 'RW', 'SA', 'SB', 'SC', 'SH', 'SL', 'SN', 'SO', 'SR', 'ST', 'SV', 'SZ', 'TC', 'TD', 'TG', 'TH',
'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UG', 'UY', 'UZ', 'VC', 'VE', 'VG', 'VN',
'VU', 'WS', 'ZM', 'ZW'
],
title: getLocale('upholdPromoEquitiesTitle')
}
default:
return null
}
Expand Down
3 changes: 3 additions & 0 deletions components/resources/brave_components_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,9 @@
<message name="IDS_BRAVE_UI_UPHOLD_PROMO_TITLE" desc="">Get 2% cryptoback with the Uphold card</message>
<message name="IDS_BRAVE_UI_UPHOLD_PROMO_INFO" desc="">Spend your crypto and other assets at nearly 50 million merchants and ATMs worldwide. Spend crypto to get crypto!</message>

<message name="IDS_BRAVE_UI_UPHOLD_PROMO_EQUITIES_TITLE" desc="">U.S. equities trading available on Uphold</message>
<message name="IDS_BRAVE_UI_UPHOLD_PROMO_EQUITIES_INFO" desc="">Invest as little as &#36;1 in popular stocks and exchange traded funds such as AAPL, TSLA or AMZN</message>

<!-- Rewards New Tab Widget resources -->
<message name="IDS_REWARDS_WIDGET_ABOUT_REWARDS" desc="">
<ph name="LINK_BEGIN">$1</ph>Learn more<ph name="LINK_END">$2</ph> about Brave Rewards
Expand Down

0 comments on commit d13badb

Please sign in to comment.