File tree Expand file tree Collapse file tree 3 files changed +29
-10
lines changed
Expand file tree Collapse file tree 3 files changed +29
-10
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { SITE_URL } from "@/lib/constants";
77import { FestiveModal } from "@/components/FestiveModal" ;
88import { FeatureModal } from "@/components/FeatureModal" ;
99import Script from "next/script" ;
10- import { Popunder } from "@/components/ads" ;
10+ import { Popunder , SocialBar } from "@/components/ads" ;
1111
1212const geistSans = Geist ( {
1313 variable : "--font-geist-sans" ,
@@ -73,6 +73,7 @@ export default function RootLayout({
7373 className = { `${ geistSans . variable } ${ geistMono . variable } antialiased` }
7474 >
7575 < Popunder />
76+ < SocialBar />
7677 { /* ✅ Google Analytics script */ }
7778 < Script
7879 src = "https://www.googletagmanager.com/gtag/js?id=G-MRZ0D7MXZD"
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ export default async function Home() {
131131
132132
133133
134- < NativeBanner className = "fixed bottom-0 left-1/2 -translate-x-1/2" />
134+ { /* <NativeBanner className="fixed bottom-0 left-1/2 -translate-x-1/2" /> */ }
135135 </ main >
136136 ) ;
137137}
Original file line number Diff line number Diff line change 11'use client' ;
22
3- import Script from 'next/script ' ;
3+ import { useEffect , useRef } from 'react ' ;
44import { adConfig } from './config' ;
55
66interface AdProps {
77 className ?: string ;
88}
99
1010export default function SocialBar ( { className } : AdProps ) {
11+ const adRef = useRef < HTMLDivElement > ( null ) ;
12+
13+ useEffect ( ( ) => {
14+ if ( adConfig . disableAds || ! adRef . current ) return ;
15+
16+ const container = adRef . current ;
17+
18+ // Clear previous content
19+ container . innerHTML = '' ;
20+
21+ const script = document . createElement ( 'script' ) ;
22+ script . type = 'text/javascript' ;
23+ // Social bar script source
24+ script . src = '//pl27751387.effectivegatecpm.com/a3/4a/86/a34a865697fcbff52b5eca6ada6baccc.js' ;
25+
26+ container . appendChild ( script ) ;
27+
28+ return ( ) => {
29+ if ( container ) {
30+ container . innerHTML = '' ;
31+ }
32+ } ;
33+ } , [ ] ) ;
34+
1135 if ( adConfig . disableAds ) return null ;
1236
1337 return (
14- < div className = { className } >
15- < Script
16- type = "text/javascript"
17- src = "//pl27751387.effectivegatecpm.com/a3/4a/86/a34a865697fcbff52b5eca6ada6baccc.js"
18- strategy = "afterInteractive"
19- />
20- </ div >
38+ < div ref = { adRef } className = { className } />
2139 ) ;
2240}
You can’t perform that action at this time.
0 commit comments