Skip to content

Commit

Permalink
Merge pull request #6943 from brave/cdc-fixes-2-17
Browse files Browse the repository at this point in the history
Removing back arrow in asset detail view, updating top buy link [crypto.com widget 1.17]
  • Loading branch information
kjozwiak authored Oct 25, 2020
2 parents 9b26366 + 8531d77 commit bf39a75
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ class CryptoDotCom extends React.PureComponent<Props, State> {
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()
Expand Down Expand Up @@ -341,7 +346,7 @@ class CryptoDotCom extends React.PureComponent<Props, State> {
</Text>
</FlexItem>
<FlexItem $pl={5}>
<ActionButton onClick={this.onClickBuyPair.bind(this, `${currency}_USDT`)} small={true} light={true}>
<ActionButton onClick={this.onClickBuyTopDetail} small={true} light={true}>
<UpperCaseText>
{getLocale('cryptoDotComWidgetBuy')}
</UpperCaseText>
Expand Down Expand Up @@ -411,7 +416,10 @@ class CryptoDotCom extends React.PureComponent<Props, State> {
}

renderTitle () {
const { selectedAsset } = this.state
const { optInMarkets, showContent } = this.props
const shouldShowBackArrow = !selectedAsset && showContent && optInMarkets

return (
<Header showContent={showContent}>
<StyledTitle>
Expand All @@ -421,7 +429,7 @@ class CryptoDotCom extends React.PureComponent<Props, State> {
<StyledTitleText>
{'Crypto.com'}
</StyledTitleText>
{showContent && optInMarkets &&
{shouldShowBackArrow &&
<BackArrow marketView={true}>
<CaratLeftIcon
onClick={this.optInMarkets.bind(this, false)}
Expand Down

0 comments on commit bf39a75

Please sign in to comment.