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

Removing back arrow in asset detail view, updating top buy link [crypto.com widget 1.17] #6943

Merged
merged 1 commit into from
Oct 25, 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
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