diff --git a/client/src/components/adsense-ad.tsx b/client/src/components/adsense-ad.tsx index 179bd15..a1d9911 100644 --- a/client/src/components/adsense-ad.tsx +++ b/client/src/components/adsense-ad.tsx @@ -5,6 +5,8 @@ interface AdSenseAdProps { adFormat?: 'auto' | 'rectangle' | 'vertical' | 'horizontal'; width?: number; height?: number; + mobileWidth?: number; + mobileHeight?: number; className?: string; lazy?: boolean; } @@ -14,6 +16,8 @@ export default function AdSenseAd({ adFormat = 'auto', width, height, + mobileWidth, + mobileHeight, className = '', lazy = false }: AdSenseAdProps) { @@ -57,7 +61,44 @@ export default function AdSenseAd({ } }, [adSlot, lazy]); - // Fixed size configuration + // Responsive configuration + const hasResponsiveSizes = (width && height) || (mobileWidth && mobileHeight); + + if (hasResponsiveSizes) { + // Responsive ads with different sizes for desktop/mobile + return ( +
+ {/* Desktop ad */} + + {/* Mobile ad */} + +
+ ); + } + + // Standard configuration (non-responsive) const isFixedSize = width && height; const adStyle: React.CSSProperties = { display: 'inline-block' diff --git a/client/src/pages/LivePage.tsx b/client/src/pages/LivePage.tsx index 47f6a33..e90dcc7 100644 --- a/client/src/pages/LivePage.tsx +++ b/client/src/pages/LivePage.tsx @@ -457,15 +457,14 @@ export default function LivePage() { {/* AdSense Ad under video stream */}
- - -