Skip to content

Commit c11af8e

Browse files
committed
Render only one ad banner container on home page
1 parent 0847ad5 commit c11af8e

File tree

14 files changed

+77
-102
lines changed

14 files changed

+77
-102
lines changed

configs/envs/.env.eth

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,25 @@ NEXT_PUBLIC_APP_PORT=3000
99
NEXT_PUBLIC_APP_ENV=development
1010
NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=ws
1111

12-
# Clusters feature
13-
NEXT_PUBLIC_CLUSTERS_API_HOST=https://api.clusters.xyz
14-
NEXT_PUBLIC_CLUSTERS_CDN_URL=https://cdn.clusters.xyz
15-
1612
# Instance ENVs
17-
NEXT_PUBLIC_ADDRESS_3RD_PARTY_WIDGETS=['talentprotocol', 'efp', 'webacy', 'deepdao', 'humanpassport', 'trustblock', 'smartmuv', 'blockscoutbadges', 'etherscore', 'bubblemaps', 'goplus', 'gitpoap', 'kwik', 'drops', 'humanode']
13+
NEXT_PUBLIC_AD_ADBUTLER_CONFIG_DESKTOP={"id":"728471","width":"728","height":"90"}
14+
NEXT_PUBLIC_AD_ADBUTLER_CONFIG_MOBILE={"id":"728470","width":"320","height":"100"}
15+
NEXT_PUBLIC_AD_BANNER_ADDITIONAL_PROVIDER=adbutler
16+
NEXT_PUBLIC_AD_BANNER_ENABLE_SPECIFY=true
17+
NEXT_PUBLIC_ADDRESS_3RD_PARTY_WIDGETS=['talentprotocol','drops','blockscoutbadges','gitpoap','efp','etherscore','webacy','humanpassport','trustblock','smartmuv','bubblemaps','humanode','deepdao']
1818
NEXT_PUBLIC_ADDRESS_3RD_PARTY_WIDGETS_CONFIG_URL=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/widgets/config.json
1919
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST=https://admin-rs.services.blockscout.com
2020
NEXT_PUBLIC_API_BASE_PATH=/
2121
NEXT_PUBLIC_API_HOST=eth.blockscout.com
2222
NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml
23+
NEXT_PUBLIC_BEACON_CHAIN_VALIDATOR_URL_TEMPLATE=https://beaconcha.in/validator/{pk}
2324
NEXT_PUBLIC_CONTRACT_CODE_IDES=[{'title':'Remix IDE','url':'https://remix.ethereum.org/?address={hash}&blockscout={domain}','icon_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/ide-icons/remix.png'}]
2425
NEXT_PUBLIC_CONTRACT_INFO_API_HOST=https://contracts-info.services.blockscout.com
2526
NEXT_PUBLIC_DATA_AVAILABILITY_ENABLED=true
26-
NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS=[{'text':'Swapscout','icon':'swap','dappId':'swapscout'},{'text':'Revokescout','icon':'integration/partial','dappId':'revokescout'},{'text':'Payment link','icon':'payment_link','dappId':'peanut-protocol'}]
27+
NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS=[{'text':'Swap','icon':'swap','url':'https://eth.blockscout.com/essential-dapps/swap?utm_source=defi-dropdown-&utm_medium=swap'},{'text':'Revoke','icon':'integration/partial','dappId':'revokescout'}, {'text': 'Multisend', 'icon': 'token', 'url': 'https://eth.blockscout.com/essential-dapps/multisend?utm_source=defi-dropdown-multisend&utm_medium=multisend'}]
2728
NEXT_PUBLIC_DEX_POOLS_ENABLED=true
2829
NEXT_PUBLIC_FEATURED_NETWORKS=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/featured-networks/eth.json
30+
NEXT_PUBLIC_FEATURED_NETWORKS_ALL_LINK=https://chains.blockscout.com/
2931
NEXT_PUBLIC_FOOTER_LINKS=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/footer-links/eth-mainnet.json
3032
NEXT_PUBLIC_GAME_BADGE_CLAIM_LINK=https://badges.blockscout.com/mint/sherblockHolmesBadge
3133
NEXT_PUBLIC_GAS_REFUEL_PROVIDER_CONFIG={'name': 'Need gas?', 'url_template': 'https://www.gas.zip?utm_source=blockscout', 'logo': 'https://blockscout-content.s3.amazonaws.com/smolrefuel-logo-action-button.png'}
@@ -37,26 +39,27 @@ NEXT_PUBLIC_HIDE_INDEXING_ALERT_BLOCKS=true
3739
NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs', 'coin_price', 'market_cap']
3840
NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true
3941
NEXT_PUBLIC_MAINTENANCE_ALERT_MESSAGE=<p>Launch your own fully functioning blockchain explorer in minutes. <a href="https://deploy.blockscout.com/?utm_source=blockscout_ad">Deploy now</a></p>
40-
NEXT_PUBLIC_MARKETPLACE_BANNER_CONTENT_URL=https://gist.githubusercontent.com/0xdeval/b27a4aecaad513fa033e37430a4f9a47/raw/3a2fa70068ea27c3e6d58dc4cdbeb732968d62f3/revokescout-banner.html
41-
NEXT_PUBLIC_MARKETPLACE_BANNER_LINK_URL=https://eth.blockscout.com/apps/revokescout?chainId=1
42+
NEXT_PUBLIC_MARKETPLACE_BANNER_CONTENT_URL=https://gist.githubusercontent.com/0xdeval/1a7395339d20b603b9c1d0ee929f23dc/raw/55e2eebef3ba3ef064842d15555b59d5ba8cbcc7/badges-banner.html
43+
NEXT_PUBLIC_MARKETPLACE_BANNER_LINK_URL=https://badges.blockscout.com/badges-list?utm_source=blockscout-explorer&utm_medium=marketplace-banner
4244
NEXT_PUBLIC_MARKETPLACE_CATEGORIES_URL=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-categories/default.json
4345
NEXT_PUBLIC_MARKETPLACE_ENABLED=true
46+
# NEXT_PUBLIC_MARKETPLACE_ESSENTIAL_DAPPS_CONFIG={'swap': {'chains': ['1', '10', '30', '100', '122', '130', '137', '324', '480', '1135', '1514', '1868', '8453', '13371', '42161', '42220', '57073', '534352', '11155111', '1313161554', '1923', '42793', '59144'], 'fee': '0.004', 'integrator': 'blockscout'}, 'multisend': {'chains': ['1', '10', '30', '100', '122', '130', '137', '324', '480', '1135', '1514', '1868', '8453', '13371', '42161', '42220', '57073', '534352', '11155111', '1313161554', '59144', '7000'], 'posthogKey': 'phc_7O4WGsecqqDO1PeaKayHAxUWN1PjheOmQCiDxEMcmkx', 'posthogHost': 'https://us.i.posthog.com'}}
4447
NEXT_PUBLIC_MARKETPLACE_SUBMIT_FORM=https://airtable.com/appiy5yijZpMMSKjT/shr6uMGPKjj1DK7NL
4548
NEXT_PUBLIC_MARKETPLACE_SUGGEST_IDEAS_FORM=https://airtable.com/appiy5yijZpMMSKjT/pag3t82DUCyhGRZZO/form
46-
NEXT_PUBLIC_MARKETPLACE_ESSENTIAL_DAPPS_CONFIG={'swap': {'chains': ['1', '10', '30', '100', '122', '130', '137', '324', '480', '1135', '1514', '1868', '8453', '13371', '42161', '42220', '57073', '534352', '11155111', '1313161554'], 'fee': '0.004', 'integrator': 'blockscout'}, 'revoke': {'chains': ['1', '10', '30', '100', '122', '130', '137', '324', '480', '1135', '1514', '1868', '8453', '13371', '42161', '42220', '57073', '534352', '11155111', '1313161554']}, 'multisend': {'chains': ['1', '10', '30', '100', '122', '130', '137', '324', '480', '1135', '1514', '1868', '8453', '13371', '42161', '42220', '57073', '534352', '11155111', '1313161554']}}
4749
NEXT_PUBLIC_METADATA_SERVICE_API_HOST=https://metadata.services.blockscout.com
4850
NEXT_PUBLIC_METASUITES_ENABLED=true
51+
# NEXT_PUBLIC_MIXPANEL_CONFIG_OVERRIDES={"record_sessions_percent": 0.5,"record_heatmap_data": true}
4952
NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG=[{'name': 'zerion', 'url_template': 'https://app.zerion.io/{address}/overview', 'logo': 'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-logos/zerion.svg'},{'name': 'zapper', 'url_template': 'https://zapper.xyz/account/{address}', 'logo': 'https://blockscout-content.s3.amazonaws.com/zapper-icon.png'}]
5053
NEXT_PUBLIC_NAME_SERVICE_API_HOST=https://bens.services.blockscout.com
51-
NEXT_PUBLIC_NAVIGATION_HIGHLIGHTED_ROUTES=['/pools']
54+
NEXT_PUBLIC_NAVIGATION_HIGHLIGHTED_ROUTES=['/apps']
55+
NEXT_PUBLIC_NAVIGATION_PROMO_BANNER_CONFIG={"img_url": {"small": "https://blockscout-merits-images.s3.us-east-1.amazonaws.com/banners/sidemenu-banner-small.png", "large": "https://blockscout-merits-images.s3.us-east-1.amazonaws.com/banners/sidemenu-banner-big.png"}, "link_url": "https://www.blockscout.com/?utm_source=blockscout&utm_medium=side-menu-banner"}
5256
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18
5357
NEXT_PUBLIC_NETWORK_CURRENCY_NAME=Ether
5458
NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL=ETH
55-
NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Moralis','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/moralis.png','baseUrl':'https://moralis.com/','paths':{'token':'/chain/ethereum/token/price'}},{'title':'GeckoTerminal','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/geckoterminal.png','baseUrl':'https://www.geckoterminal.com/','paths':{'token':'/eth/pools'}},{'title':'Etherscan','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/etherscan.png','baseUrl':'https://etherscan.io/','paths':{'tx':'/tx','address':'/address','token':'/token','block':'/block'}}, {'title':'Blockchair','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/blockchair.png','baseUrl':'https://blockchair.com/','paths':{'tx':'/ethereum/transaction','address':'/ethereum/address','token':'/ethereum/erc-20/token','block':'/ethereum/block'}},{'title':'Sentio','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/sentio.png','baseUrl':'https://app.sentio.xyz/','paths':{'tx':'/tx/1','address':'/contract/1'}}, {'title':'Tenderly','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/tenderly.png','baseUrl':'https://dashboard.tenderly.co','paths':{'tx':'/tx/mainnet'}}, {'title':'0xPPL','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/0xPPL.png','baseUrl':'https://0xppl.com','paths':{'tx':'/Ethereum/tx','address':'/','token':'/c/Ethereum'}}, {'title':'3xpl','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/3xpl.png','baseUrl':'https://3xpl.com/','paths':{'tx':'/ethereum/transaction','address':'/ethereum/address'}} ]
59+
NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Moralis','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/moralis.png','baseUrl':'https://explorer.moralis.com/','paths':{'token':'/chain/ethereum/token/price'}},{'title':'GeckoTerminal','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/geckoterminal.png','baseUrl':'https://www.geckoterminal.com/','paths':{'token':'/eth/pools'}},{'title':'Etherscan','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/etherscan.png','baseUrl':'https://etherscan.io/','paths':{'tx':'/tx','address':'/address','token':'/token','block':'/block'}}, {'title':'Blockchair','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/blockchair.png','baseUrl':'https://blockchair.com/','paths':{'tx':'/ethereum/transaction','address':'/ethereum/address','token':'/ethereum/erc-20/token','block':'/ethereum/block'}},{'title':'Sentio','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/sentio.png','baseUrl':'https://app.sentio.xyz/','paths':{'tx':'/tx/1','address':'/contract/1'}}, {'title':'Tenderly','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/tenderly.png','baseUrl':'https://dashboard.tenderly.co','paths':{'tx':'/tx/mainnet'}}, {'title':'0xPPL','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/0xPPL.png','baseUrl':'https://0xppl.com','paths':{'tx':'/Ethereum/tx','address':'/','token':'/c/Ethereum'}}, {'title':'3xpl','logo':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/explorer-logos/3xpl.png','baseUrl':'https://3xpl.com/','paths':{'tx':'/ethereum/transaction','address':'/ethereum/address'}},{'title':'BlobScan','logo':'https://raw.githubusercontent.com/Blobscan/blobscan/main/.github/assets/logo.svg','baseUrl':'https://blobscan.com','paths':{'blob':'/blob'}} ]
5660
NEXT_PUBLIC_NETWORK_ID=1
5761
NEXT_PUBLIC_NETWORK_NAME=Ethereum
5862
NEXT_PUBLIC_NETWORK_RPC_URL=https://rpc.eth.gateway.fm
59-
NEXT_PUBLIC_NETWORK_SHORT_NAME=Ethereum
6063
NEXT_PUBLIC_NETWORK_VERIFICATION_TYPE=validation
6164
NEXT_PUBLIC_OG_ENHANCED_DATA_ENABLED=true
6265
NEXT_PUBLIC_OG_IMAGE_URL=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/og-images/eth.jpg
@@ -68,8 +71,10 @@ NEXT_PUBLIC_SAVE_ON_GAS_ENABLED=true
6871
NEXT_PUBLIC_STATS_API_BASE_PATH=/stats-service
6972
NEXT_PUBLIC_STATS_API_HOST=https://eth.blockscout.com
7073
NEXT_PUBLIC_TRANSACTION_INTERPRETATION_PROVIDER=blockscout
74+
NEXT_PUBLIC_USER_OPS_INDEXER_API_HOST=https://user-ops-indexer-eth-main.k8s-prod-1.blockscout.com
75+
NEXT_PUBLIC_VIEWS_CONTRACT_LANGUAGE_FILTERS=['solidity','vyper','yul','geas']
7176
NEXT_PUBLIC_VIEWS_CONTRACT_SOLIDITYSCAN_ENABLED=true
72-
NEXT_PUBLIC_VIEWS_NFT_MARKETPLACES=[{'name':'OpenSea','collection_url':'https://opensea.io/assets/ethereum/{hash}','instance_url':'https://opensea.io/assets/ethereum/{hash}/{id}','logo_url':'https://opensea.io/static/images/logos/opensea-logo.svg'},{'name':'Rarible','collection_url':'https://rarible.com/collection/{hash}/items','instance_url':'https://rarible.com/token/{hash}:{id}','logo_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/nft-marketplace-logos/rarible.png'},{'name':'Blur','collection_url':'https://blur.io/eth/collection/{hash}','instance_url':'https://blur.io/eth/asset/{hash}/{id}','logo_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/nft-marketplace-logos/blur.png'},{'name':'MagicEden','collection_url':'https://magiceden.io/collections/ethereum/{hash}','instance_url':'https://magiceden.io/item-details/ethereum/{hash}/{id}','logo_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/nft-marketplace-logos/magiceden.png'}]
77+
NEXT_PUBLIC_VIEWS_NFT_MARKETPLACES=[{'name':'OpenSea','collection_url':'https://opensea.io/assets/ethereum/{hash}','instance_url':'https://opensea.io/assets/ethereum/{hash}/{id}','logo_url':'https://storage.googleapis.com/opensea-static/Logomark/Logomark-Blue.svg'},{'name':'Rarible','collection_url':'https://rarible.com/collection/{hash}/items','instance_url':'https://rarible.com/token/{hash}:{id}','logo_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/nft-marketplace-logos/rarible.png'},{'name':'Blur','collection_url':'https://blur.io/eth/collection/{hash}','instance_url':'https://blur.io/eth/asset/{hash}/{id}','logo_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/nft-marketplace-logos/blur.png'},{'name':'MagicEden','collection_url':'https://magiceden.io/collections/ethereum/{hash}','instance_url':'https://magiceden.io/item-details/ethereum/{hash}/{id}','logo_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/nft-marketplace-logos/magiceden.png'}]
7378
NEXT_PUBLIC_VIEWS_TOKEN_SCAM_TOGGLE_ENABLED=true
7479
NEXT_PUBLIC_VISUALIZE_API_HOST=https://visualizer.services.blockscout.com
75-
NEXT_PUBLIC_XSTAR_SCORE_URL=https://docs.xname.app/the-solution-adaptive-proof-of-humanity-on-blockchain/xhs-scoring-algorithm?utm_source=blockscout&utm_medium=address
80+
NEXT_PUBLIC_XSTAR_SCORE_URL=https://docs.xname.app/the-solution-adaptive-proof-of-humanity-on-blockchain/xhs-scoring-algorithm?utm_source=blockscout&utm_medium=address

nextjs/csp/policies/ad.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export function ad(): CspDev.DirectiveDescriptor {
3232
// adbutler
3333
'servedbyadbutler.com',
3434
`'sha256-${ Base64.stringify(sha256(connectAdbutler)) }'`,
35-
`'sha256-${ Base64.stringify(sha256(placeAd(undefined) ?? '')) }'`,
36-
`'sha256-${ Base64.stringify(sha256(placeAd('mobile') ?? '')) }'`,
35+
`'sha256-${ Base64.stringify(sha256(placeAd(false) ?? '')) }'`,
36+
`'sha256-${ Base64.stringify(sha256(placeAd(true) ?? '')) }'`,
3737

3838
// slise
3939
'*.slise.xyz',

ui/home/HeroBanner.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Box, Flex, Heading } from '@chakra-ui/react';
44
import React from 'react';
55

66
import config from 'configs/app';
7+
import useIsMobile from 'lib/hooks/useIsMobile';
78
import RewardsButton from 'ui/rewards/RewardsButton';
89
import AdBanner from 'ui/shared/ad/AdBanner';
910
import SearchBar from 'ui/snippets/searchBar/SearchBarDesktop';
@@ -17,6 +18,9 @@ const TEXT_COLOR_DEFAULT = 'white';
1718
const BORDER_DEFAULT = 'none';
1819

1920
const HeroBanner = () => {
21+
22+
const isMobile = useIsMobile();
23+
2024
const background = {
2125
_light:
2226
config.UI.homepage.heroBanner?.background?.[0] ||
@@ -88,7 +92,7 @@ const HeroBanner = () => {
8892
<SearchBar isHeroBanner/>
8993
</Box>
9094
</Box>
91-
<AdBanner platform="mobile" w="fit-content" flexShrink={ 0 } borderRadius="md" overflow="hidden" display={{ base: 'none', lg: 'block ' }}/>
95+
{ !isMobile && <AdBanner format="mobile" w="fit-content" flexShrink={ 0 } borderRadius="md" overflow="hidden"/> }
9296
</Flex>
9397
);
9498
};

ui/pages/Home.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Box, Flex } from '@chakra-ui/react';
22
import React from 'react';
33

44
import config from 'configs/app';
5+
import useIsMobile from 'lib/hooks/useIsMobile';
56
import HeroBanner from 'ui/home/HeroBanner';
67
import ChainIndicators from 'ui/home/indicators/ChainIndicators';
78
import LatestArbitrumL2Batches from 'ui/home/latestBatches/LatestArbitrumL2Batches';
@@ -14,6 +15,7 @@ import AdBanner from 'ui/shared/ad/AdBanner';
1415
const rollupFeature = config.features.rollup;
1516

1617
const Home = () => {
18+
const isMobile = useIsMobile();
1719

1820
const leftWidget = (() => {
1921
if (rollupFeature.isEnabled && !rollupFeature.homepage.showLatestBlocks) {
@@ -35,7 +37,7 @@ const Home = () => {
3537
<Stats/>
3638
<ChainIndicators/>
3739
</Flex>
38-
<AdBanner mt={ 6 } mx="auto" display={{ base: 'flex', lg: 'none' }} justifyContent="center"/>
40+
{ isMobile && <AdBanner mt={ 6 } mx="auto" justifyContent="center" format="mobile"/> }
3941
<Flex mt={ 8 } direction={{ base: 'column', lg: 'row' }} columnGap={ 12 } rowGap={ 6 }>
4042
{ leftWidget }
4143
<Box flexGrow={ 1 }>

ui/pages/RewardsDashboard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useEffect, useState } from 'react';
33

44
import config from 'configs/app';
55
import { useRewardsContext } from 'lib/contexts/rewards';
6+
import useIsMobile from 'lib/hooks/useIsMobile';
67
import { Alert } from 'toolkit/chakra/alert';
78
import { Button } from 'toolkit/chakra/button';
89
import { Link } from 'toolkit/chakra/link';
@@ -25,6 +26,7 @@ const RewardsDashboard = () => {
2526
const { balancesQuery, apiToken, referralsQuery, rewardsConfigQuery, dailyRewardQuery, isInitialized } = useRewardsContext();
2627
const { nextAchievementText, isLoading: isBadgesLoading, badgesQuery } = useStreakBadges();
2728
const streakModal = useDisclosure();
29+
const isMobile = useIsMobile();
2830

2931
const [ isError, setIsError ] = useState(false);
3032

@@ -59,7 +61,7 @@ const RewardsDashboard = () => {
5961
) }
6062
mb={ 0 }
6163
/>
62-
<AdBanner platform="mobile" w="fit-content" flexShrink={ 0 } borderRadius="md" overflow="hidden" display={{ base: 'none', lg: 'block ' }}/>
64+
{ !isMobile && <AdBanner format="mobile" w="fit-content" flexShrink={ 0 } borderRadius="md" overflow="hidden"/> }
6365
</Flex>
6466
<Flex flexDirection="column" alignItems="flex-start" w="full" gap={ 6 }>
6567
{ isError && <Alert status="error">Failed to load some data. Please try again later.</Alert> }

ui/shared/DetailedInfo/DetailedInfoSponsoredItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const DetailedInfoSponsoredItem = ({ isLoading }: Props) => {
2828
Sponsored
2929
</DetailedInfo.ItemLabel>
3030
<DetailedInfo.ItemValue mt={{ base: 0, lg: 1 }}>
31-
<AdBanner isLoading={ isLoading }/>
31+
<AdBanner format="responsive" isLoading={ isLoading }/>
3232
</DetailedInfo.ItemValue>
3333
</>
3434
);

ui/shared/ad/AdBanner.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { chakra } from '@chakra-ui/react';
22
import React from 'react';
33

4-
import type { BannerPlatform } from './types';
4+
import type { BannerFormat } from './types';
55

66
import config from 'configs/app';
77
import { useAppContext } from 'lib/contexts/app';
@@ -14,10 +14,10 @@ const feature = config.features.adsBanner;
1414
interface Props {
1515
className?: string;
1616
isLoading?: boolean;
17-
platform?: BannerPlatform;
17+
format?: BannerFormat;
1818
}
1919

20-
const AdBanner = ({ className, isLoading, platform }: Props) => {
20+
const AdBanner = ({ className, isLoading, format }: Props) => {
2121
const provider = useAppContext().adBannerProvider;
2222

2323
const hasAdblockCookie = cookies.get(cookies.NAMES.ADBLOCK_DETECTED, useAppContext().cookies);
@@ -31,7 +31,7 @@ const AdBanner = ({ className, isLoading, platform }: Props) => {
3131
className={ className }
3232
isLoading={ isLoading }
3333
provider={ provider }
34-
platform={ platform }
34+
format={ format }
3535
/>
3636
);
3737
};

0 commit comments

Comments
 (0)