From 98cbe292b0490bfac9766c4494dc0bd887191cab Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Sat, 27 Sep 2025 05:14:27 +0000 Subject: [PATCH] Adjust ad sizes for mobile and desktop displays Introduce responsive ad size configurations in `AdSenseAd.tsx` to display smaller ads on mobile devices and larger ads on desktop for both live and video pages. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 45a1dcfc-f8a2-475a-a6b9-96fbb841dc27 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/60d372ff-2c10-46c7-b01b-10c3435136b0/45a1dcfc-f8a2-475a-a6b9-96fbb841dc27/JMKe3od --- client/src/components/adsense-ad.tsx | 43 +++++++++++++++++++++++++++- client/src/pages/LivePage.tsx | 27 ++++++++++------- client/src/pages/VideoPage.tsx | 15 ++++++++-- 3 files changed, 70 insertions(+), 15 deletions(-) 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 ( +