Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds uphold equities card #6951

Merged
merged 1 commit into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -783,6 +783,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 },
{ "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.
30 changes: 24 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,18 @@ 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: ['US'],
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 @@ -812,6 +812,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