Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 318f948

Browse files
author
plondon
committed
fix(Ads): blacklist
1 parent a7f80fd commit 318f948

6 files changed

Lines changed: 30 additions & 8 deletions

File tree

config/mocks/wallet-options-v4.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"wallet": {}
1313
}
1414
},
15+
"ads": {
16+
"blacklist": ["LT", "LU", "UK", "US"]
17+
},
1518
"coins": {
1619
"BTC": {
1720
"availability": {

packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/MenuLeft/Footer/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import styled from 'styled-components'
3+
import { contains } from 'ramda'
34
import { bindActionCreators } from 'redux'
45
import { connect } from 'react-redux'
56
import { actions, model } from 'data'
@@ -20,13 +21,15 @@ const AdsButton = styled(Button)`
2021
const ButtonText = styled(Text)`
2122
display: flex;
2223
white-space: nowrap;
24+
align-items: center;
2325
`
2426
const ArrowIcon = styled(Icon)`
2527
margin-left: 4px;
2628
`
2729

28-
const Footer = ({ actions }) => {
29-
return (
30+
const Footer = ({ actions, countryCode, adsBlacklist }) => {
31+
const isBlacklisted = contains(countryCode, adsBlacklist)
32+
return isBlacklisted ? null : (
3033
<Wrapper>
3134
<Text color='gray-3' size='12px' weight={500}>
3235
<FormattedMessage

packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/MenuLeft/selectors.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,38 @@ export const getData = createDeepEqualSelector(
1111
selectors.components.layoutWallet.getLockboxOpened,
1212
selectors.exchange.getCanTrade,
1313
selectors.router.getPathname,
14-
selectors.core.kvStore.lockbox.getDevices
14+
selectors.core.kvStore.lockbox.getDevices,
15+
selectors.core.settings.getCountryCode,
16+
selectors.core.walletOptions.getAdsBlacklist
1517
],
1618
(
1719
swapOrTradeTestR,
1820
menuOpened,
1921
lockboxOpened,
2022
canTradeR,
2123
pathname,
22-
lockboxDevicesR
24+
lockboxDevicesR,
25+
countryCodeR,
26+
adsBlacklistR
2327
) => {
24-
const transform = (swapOrTrade, canTrade, lockboxDevices) => {
28+
const transform = (swapOrTrade, canTrade, lockboxDevices, countryCode) => {
2529
return {
2630
swapOrTrade,
2731
canTrade,
2832
pathname,
2933
menuOpened,
3034
lockboxOpened,
31-
lockboxDevices
35+
lockboxDevices,
36+
countryCode,
37+
adsBlacklist: adsBlacklistR.getOrElse([])
3238
}
3339
}
3440

35-
return lift(transform)(swapOrTradeTestR, canTradeR, lockboxDevicesR)
41+
return lift(transform)(
42+
swapOrTradeTestR,
43+
canTradeR,
44+
lockboxDevicesR,
45+
countryCodeR
46+
)
3647
}
3748
)

packages/blockchain-wallet-v4-frontend/src/layouts/Wallet/MenuLeft/template.success.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const MenuLeft = props => (
4444
<Container toggled={props.menuOpened}>
4545
<Overflow>
4646
<Navigation {...props} />
47-
<Footer />
47+
<Footer {...props} />
4848
</Overflow>
4949
</Container>
5050
)

packages/blockchain-wallet-v4/src/redux/walletOptions/__mocks__/wallet-options-v4.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export default {
1212
wallet: {}
1313
}
1414
},
15+
ads: {
16+
blacklist: ['LT', 'LU', 'UK', 'US']
17+
},
1518
coins: {
1619
BTC: {
1720
availability: {

packages/blockchain-wallet-v4/src/redux/walletOptions/selectors.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export const getMigrationRedirects = state =>
3030
getWebOptions(state).map(
3131
path(['application', 'enableDomainMigrationRedirects'])
3232
)
33+
export const getAdsBlacklist = state =>
34+
getWebOptions(state).map(path(['ads', 'blacklist']))
3335

3436
// coins
3537
export const getSupportedCoins = createDeepEqualSelector(

0 commit comments

Comments
 (0)