From a04465f26576b352368200056f3a9cd9dd175216 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 6 Nov 2026 19:49:11 +0200 Subject: [PATCH] After improving the design for the web part7 --- prediqo_web/src/features/home/HomePage.tsx | 32 ++++++++++++------- .../home/components/PromoCarousel.tsx | 23 ++----------- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/prediqo_web/src/features/home/HomePage.tsx b/prediqo_web/src/features/home/HomePage.tsx index 82689f3e..db71de06 100644 --- a/prediqo_web/src/features/home/HomePage.tsx +++ b/prediqo_web/src/features/home/HomePage.tsx @@ -51,6 +51,9 @@ export function HomePage() { const liveCount = games.filter((g) => g.status === 'active').length; const featuredCount = games.filter((g) => g.isFeatured).length; + const hasHero = (heroQ.data?.length ?? 0) > 0; + const showHero = heroQ.isLoading || hasHero; + const hasStrip = (stripQ.data?.length ?? 0) > 0; const refreshAll = async () => { await Promise.all([gamesQ.refetch(), heroQ.refetch(), stripQ.refetch()]); @@ -90,13 +93,16 @@ export function HomePage() { sx={{ display: 'grid', gap: 2.5, - gridTemplateColumns: { xs: '1fr', lg: '1fr 300px' }, + gridTemplateColumns: { + xs: '1fr', + lg: hasStrip ? '1fr 300px' : '1fr', + }, alignItems: 'start', mb: 3, }} > - + {showHero && } - + {hasStrip && ( + + + {t('home.promotions')} + + + + )} + + + {hasStrip && ( + {t('home.promotions')} - - - - - {t('home.promotions')} - - - + )} window.clearInterval(timer); }, [count]); - if (loading) { + if (loading && count === 0) { return ( - - New promotions coming soon — check back later. - - - ); - } + // No campaigns published → reclaim space (no empty placeholder). + if (count === 0) return null; const ad = ads[index]; const bg = ad.backgroundGradient || defaultGradient;