mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
add slise banner
This commit is contained in:
@@ -45,6 +45,7 @@ NEXT_PUBLIC_HOMEPAGE_SHOW_GAS_TRACKER=__PLACEHOLDER_FOR_NEXT_PUBLIC_HOMEPAGE_SHO
|
||||
NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME=__PLACEHOLDER_FOR_NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME__
|
||||
NEXT_PUBLIC_AD_DOMAIN_WITH_AD=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_DOMAIN_WITH_AD__
|
||||
NEXT_PUBLIC_AD_ADBUTLER_ON=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_ADBUTLER_ON__
|
||||
NEXT_PUBLIC_AD_SLISE_ON=__PLACEHOLDER_FOR_NEXT_PUBLIC_AD_SLISE_ON__
|
||||
NEXT_PUBLIC_GRAPHIQL_TRANSACTION=__PLACEHOLDER_FOR_NEXT_PUBLIC_GRAPHIQL_TRANSACTION__
|
||||
NEXT_PUBLIC_WEB3_DEFAULT_WALLET=__PLACEHOLDER_FOR_NEXT_PUBLIC_WEB3_DEFAULT_WALLET__
|
||||
NEXT_PUBLIC_WEB3_DISABLE_ADD_TOKEN_TO_WALLET=__PLACEHOLDER_FOR_NEXT_PUBLIC_WEB3_DISABLE_ADD_TOKEN_TO_WALLET__
|
||||
|
||||
@@ -114,6 +114,7 @@ const config = Object.freeze({
|
||||
ad: {
|
||||
domainWithAd: getEnvValue(process.env.NEXT_PUBLIC_AD_DOMAIN_WITH_AD) || 'blockscout.com',
|
||||
adButlerOn: getEnvValue(process.env.NEXT_PUBLIC_AD_ADBUTLER_ON) === 'true',
|
||||
sliseOn: getEnvValue(process.env.NEXT_PUBLIC_AD_SLISE_ON) === 'true',
|
||||
},
|
||||
web3: {
|
||||
defaultWallet: getWeb3DefaultWallet(),
|
||||
|
||||
@@ -133,3 +133,5 @@ frontend:
|
||||
_default: ref+vault://deployment-values/blockscout/dev/review?token_env=VAULT_TOKEN&address=https://vault.k8s.blockscout.com#/NEXT_PUBLIC_RE_CAPTCHA_APP_SITE_KEY
|
||||
NEXT_PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID:
|
||||
_default: ref+vault://deployment-values/blockscout/dev/review?token_env=VAULT_TOKEN&address=https://vault.k8s.blockscout.com#/NEXT_PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID
|
||||
NEXT_PUBLIC_AD_SLISE_ON:
|
||||
_default: 'true'
|
||||
|
||||
@@ -46,6 +46,7 @@ The app instance could be customized by passing following variables to NodeJS en
|
||||
| NEXT_PUBLIC_HOMEPAGE_SHOW_AVG_BLOCK_TIME | `boolean` | Set to false if average block time is useless for the network | - | `true` | `false` |
|
||||
| NEXT_PUBLIC_AD_DOMAIN_WITH_AD | `string` | The domain on which we display ads | - | - | `blockscout.com` |
|
||||
| NEXT_PUBLIC_AD_ADBUTLER_ON | `boolean` | Set to true to show Adbutler banner instead of Coinzilla banner | - | `false` | `true` |
|
||||
| NEXT_PUBLIC_AD_SLISE_ON | `boolean` | Set to true to show Slise banner instead of Coinzilla banner | - | `false` | `true` |
|
||||
| NEXT_PUBLIC_API_SPEC_URL | `string` | Spec to be displayed on api-docs page | - | - | `https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml` |
|
||||
| NEXT_PUBLIC_GRAPHIQL_TRANSACTION | `string` | Txn hash for default query at GraphQl playground page | - | - | `0x69e3923eef50eada197c3336d546936d0c994211492c9f947a24c02827568f9f` |
|
||||
| NEXT_PUBLIC_WEB3_DEFAULT_WALLET | `metamask` \| `coinbase`| Type of Web3 wallet which will be used by default to add tokens or chains to | - | `metamask` | `coinbase` |
|
||||
|
||||
@@ -12,6 +12,7 @@ export function ad(): CspDev.DirectiveDescriptor {
|
||||
'coinzilla.com',
|
||||
'*.coinzilla.com',
|
||||
'request-global.czilladx.com',
|
||||
'*.slise.xyz',
|
||||
],
|
||||
'frame-src': [
|
||||
'request-global.czilladx.com',
|
||||
@@ -19,6 +20,7 @@ export function ad(): CspDev.DirectiveDescriptor {
|
||||
'script-src': [
|
||||
'coinzillatag.com',
|
||||
'servedbyadbutler.com',
|
||||
'*.slise.xyz',
|
||||
// what hash is this?
|
||||
'\'sha256-wMOeDjJaOTjCfNjluteV+tSqHW547T89sgxd8W6tQJM=\'',
|
||||
// what hash is this?
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
"@sentry/nextjs": "^7.12.1",
|
||||
"@sentry/react": "^7.24.0",
|
||||
"@sentry/tracing": "^7.24.0",
|
||||
"@slise/embed-react": "^2.2.0",
|
||||
"@tanstack/react-query": "^4.0.10",
|
||||
"@tanstack/react-query-devtools": "^4.0.10",
|
||||
"@types/papaparse": "^5.3.5",
|
||||
|
||||
@@ -8,6 +8,7 @@ import isSelfHosted from 'lib/isSelfHosted';
|
||||
|
||||
import AdbutlerBanner from './AdbutlerBanner';
|
||||
import CoinzillaBanner from './CoinzillaBanner';
|
||||
import SliseBanner from './SliseBanner';
|
||||
|
||||
const AdBanner = ({ className, isLoading }: { className?: string; isLoading?: boolean }) => {
|
||||
const hasAdblockCookie = cookies.get(cookies.NAMES.ADBLOCK_DETECTED, useAppContext().cookies);
|
||||
@@ -16,7 +17,17 @@ const AdBanner = ({ className, isLoading }: { className?: string; isLoading?: bo
|
||||
return null;
|
||||
}
|
||||
|
||||
const content = appConfig.ad.adButlerOn ? <AdbutlerBanner/> : <CoinzillaBanner/>;
|
||||
const content = (() => {
|
||||
if (appConfig.ad.adButlerOn) {
|
||||
return <AdbutlerBanner/>;
|
||||
}
|
||||
|
||||
if (appConfig.ad.sliseOn) {
|
||||
return <SliseBanner/>;
|
||||
}
|
||||
|
||||
return <CoinzillaBanner/>;
|
||||
})();
|
||||
|
||||
return (
|
||||
<Skeleton
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Flex, chakra } from '@chakra-ui/react';
|
||||
import { SliseAd } from '@slise/embed-react';
|
||||
import React from 'react';
|
||||
|
||||
import useIsMobile from 'lib/hooks/useIsMobile';
|
||||
|
||||
const SliseBanner = ({ className }: { className?: string }) => {
|
||||
const isMobile = useIsMobile();
|
||||
return (
|
||||
<Flex className={ className } h="90px">
|
||||
<SliseAd
|
||||
slotId="leaderboard"
|
||||
pub="pub-10"
|
||||
format={ isMobile ? '270x90' : '728x90' }
|
||||
style={{ width: isMobile ? '270px' : '728px', height: '90px' }}/>
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
||||
export default chakra(SliseBanner);
|
||||
@@ -3928,6 +3928,13 @@
|
||||
dependencies:
|
||||
"@sinonjs/commons" "^1.7.0"
|
||||
|
||||
"@slise/embed-react@^2.2.0":
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@slise/embed-react/-/embed-react-2.2.0.tgz#346bf34d375144a7f5173354c1672d3687fa8b47"
|
||||
integrity sha512-btboJc24ABEg5ncbVnab+asKarp3kTSTdMHHcndrnkCDlXNQNSw3vL0Lv8tanqgE3Ogt51AF8QGEhWDNOZAcxQ==
|
||||
dependencies:
|
||||
react-script-hook "^1.7.2"
|
||||
|
||||
"@solana/buffer-layout@^4.0.0":
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz#b996235eaec15b1e0b5092a8ed6028df77fa6c15"
|
||||
@@ -11550,6 +11557,11 @@ react-remove-scroll@^2.4.3, react-remove-scroll@^2.5.5:
|
||||
use-callback-ref "^1.3.0"
|
||||
use-sidecar "^1.1.2"
|
||||
|
||||
react-script-hook@^1.7.2:
|
||||
version "1.7.2"
|
||||
resolved "https://registry.yarnpkg.com/react-script-hook/-/react-script-hook-1.7.2.tgz#ec130d67f9a25fcde57fbfd1faa87e5b97521948"
|
||||
integrity sha512-fhyCEfXb94fag34UPRF0zry1XGwmVY+79iibWwTqAoOiCzYJQOYTiWJ7CnqglA9tMSV8g45cQpHCMcBwr7dwhA==
|
||||
|
||||
react-scroll@^1.8.7:
|
||||
version "1.8.7"
|
||||
resolved "https://registry.yarnpkg.com/react-scroll/-/react-scroll-1.8.7.tgz#8020035329efad00f03964e18aff6822137de3aa"
|
||||
|
||||
Reference in New Issue
Block a user