diff --git a/.replit b/.replit index 25d8e76..cd990cf 100644 --- a/.replit +++ b/.replit @@ -23,10 +23,6 @@ externalPort = 3001 localPort = 35637 externalPort = 3000 -[[ports]] -localPort = 41551 -externalPort = 3002 - [env] PORT = "5000" diff --git a/client/src/components/HeaderAd.tsx b/client/src/components/HeaderAd.tsx new file mode 100644 index 0000000..52804af --- /dev/null +++ b/client/src/components/HeaderAd.tsx @@ -0,0 +1,34 @@ +import { useEffect, useRef } from 'react'; + +export default function HeaderAd() { + const adRef = useRef(null); + + useEffect(() => { + const initializeAd = () => { + const insElement = adRef.current?.querySelector('ins'); + if (!insElement || insElement.dataset.adsbygoogleStatus === 'done') return; + + try { + // @ts-ignore + (window.adsbygoogle = window.adsbygoogle || []).push({}); + } catch (error) { + console.error('Header AdSense initialization error:', error); + } + }; + + // Initialize the ad immediately + initializeAd(); + }, []); + + return ( +
+ {/* Fixed Header/Footer Ad */} + +
+ ); +} \ No newline at end of file diff --git a/client/src/pages/FolxStadlPage.tsx b/client/src/pages/FolxStadlPage.tsx index 248c65f..191b508 100644 --- a/client/src/pages/FolxStadlPage.tsx +++ b/client/src/pages/FolxStadlPage.tsx @@ -9,6 +9,7 @@ import type { Video } from '@shared/schema'; import { Input } from '@/components/ui/input'; import { Search } from 'lucide-react'; import AdSenseAd from '@/components/adsense-ad'; +import HeaderAd from '@/components/HeaderAd'; export default function FolxStadlPage() { const [selectedVideo, setSelectedVideo] = useState