From 8531d770c6effce747defcec56fe8bbf544478bf Mon Sep 17 00:00:00 2001 From: ryanml Date: Fri, 23 Oct 2020 18:16:20 -0700 Subject: [PATCH] Merge pull request #6942 from brave/cdc-fixes-2 Removing back arrow in asset detail view, updating top buy link [crypto.com widget] --- .../components/default/cryptoDotCom/data.ts | 3 ++- .../components/default/cryptoDotCom/index.tsx | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/components/brave_new_tab_ui/components/default/cryptoDotCom/data.ts b/components/brave_new_tab_ui/components/default/cryptoDotCom/data.ts index fb12e0f45301..92e30807f84b 100644 --- a/components/brave_new_tab_ui/components/default/cryptoDotCom/data.ts +++ b/components/brave_new_tab_ui/components/default/cryptoDotCom/data.ts @@ -38,7 +38,8 @@ const currencyNames = { const links = { 'buyTop': 'https://auth.crypto.com/exchange/signup?utm_source=Brave&utm_medium=Trading%20Widget&utm_campaign=Brave%3AWW-en%3ATrading-Widget_MVP_InitialWidgetState_BuyButton_Top&utm_content=MVP_InitialWidgetState_BuyButton_Top', - 'buyBottom': 'https://auth.crypto.com/exchange/signup?utm_source=Brave&utm_medium=Trading%20Widget&utm_campaign=Brave%3AWW-en%3ATrading-Widget_MVP_InitialWidgetState_BuyButton_Bottom&utm_content=MVP_InitialWidgetState_BuyButton_Bottom' + 'buyBottom': 'https://auth.crypto.com/exchange/signup?utm_source=Brave&utm_medium=Trading%20Widget&utm_campaign=Brave%3AWW-en%3ATrading-Widget_MVP_InitialWidgetState_BuyButton_Bottom&utm_content=MVP_InitialWidgetState_BuyButton_Bottom', + 'buyTopDetail': 'https://auth.crypto.com/exchange/signup?utm_source=Brave&utm_medium=Trading%20Widget&utm_campaign=Brave%3AWW-en%3ATrading-Widget_MVP_CryptoDetails_BuyButton_Top&utm_content=MVP_CryptoDetails_BuyButton_Top' } const dynamicBuyLink = (pair: string) => { diff --git a/components/brave_new_tab_ui/components/default/cryptoDotCom/index.tsx b/components/brave_new_tab_ui/components/default/cryptoDotCom/index.tsx index fecc319452de..89a6c7a87803 100644 --- a/components/brave_new_tab_ui/components/default/cryptoDotCom/index.tsx +++ b/components/brave_new_tab_ui/components/default/cryptoDotCom/index.tsx @@ -175,6 +175,11 @@ class CryptoDotCom extends React.PureComponent { await this.props.onSetAssetData([asset]) } + onClickBuyTopDetail = () => { + window.open(links.buyTopDetail, '_blank', 'noopener') + this.props.onBuyCrypto() + } + onClickBuyTop = () => { window.open(links.buyTop, '_blank', 'noopener') this.props.onBuyCrypto() @@ -341,7 +346,7 @@ class CryptoDotCom extends React.PureComponent { - + {getLocale('cryptoDotComWidgetBuy')} @@ -411,7 +416,10 @@ class CryptoDotCom extends React.PureComponent { } renderTitle () { + const { selectedAsset } = this.state const { optInMarkets, showContent } = this.props + const shouldShowBackArrow = !selectedAsset && showContent && optInMarkets + return (
@@ -421,7 +429,7 @@ class CryptoDotCom extends React.PureComponent { {'Crypto.com'} - {showContent && optInMarkets && + {shouldShowBackArrow &&