From 92f0b8c375443cd8a864d944db51492b62039488 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Mon, 16 Feb 2026 20:56:40 +0100 Subject: [PATCH] refactored desktop view of mainpage --- frontend/src/pages/MainPage.tsx | 294 ++++++++++++++++---------------- 1 file changed, 148 insertions(+), 146 deletions(-) diff --git a/frontend/src/pages/MainPage.tsx b/frontend/src/pages/MainPage.tsx index 855b2d5..91e6c58 100644 --- a/frontend/src/pages/MainPage.tsx +++ b/frontend/src/pages/MainPage.tsx @@ -214,7 +214,7 @@ const MainPage: React.FC = () => { : 'linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 100%)', borderBottom: '1px solid', borderColor: 'divider', - mb: 8 + mb: 4 }}> @@ -245,7 +245,7 @@ const MainPage: React.FC = () => { {!rating.user_avatar && rating.user.charAt(0).toUpperCase()} - {rating.user} + {rating.user} rated @@ -279,7 +279,7 @@ const MainPage: React.FC = () => { elevation={0} sx={{ p: { xs: 4, md: 10 }, - mb: 8, + mb: 4, borderRadius: 0, background: (theme) => theme.palette.mode === 'dark' ? 'linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)' @@ -310,120 +310,20 @@ const MainPage: React.FC = () => { - {/* Hall of Fame Carousel */} - {topFlavors.length > 0 && currentTop && ( - - - - - Hall of Fame - - - - - - - - - - - - - - - {currentTop.name} - - - - - - {(currentTop.average_rating || 0).toFixed(1)} / 10 - - - - {featuredReview && ( - - - "{featuredReview.comment}" - - - - {!featuredReview.user_avatar && featuredReview.user.charAt(0)} - - — {featuredReview.user} - - - )} - - - - - - {/* Progress Indicators */} - - {topFlavors.map((_, i) => ( - setActiveIndex(i)} - sx={{ - width: activeIndex === i ? 24 : 8, - height: 8, - borderRadius: 4, - bgcolor: activeIndex === i ? 'primary.main' : 'divider', - cursor: 'pointer', - transition: 'all 0.3s ease' - }} - /> - ))} - - - )} - - {/* Categories Grid */} - + {/* Categories Grid - MOVED UP */} + Browse by Category {categories.map(category => ( @@ -436,9 +336,148 @@ const MainPage: React.FC = () => { + + {/* Hall of Fame Carousel - SIDE BY SIDE */} + {topFlavors.length > 0 && currentTop && ( + + + + + Hall of Fame + + + + + + + + + + + + + + + {currentTop.name} + + + + + + {(currentTop.average_rating || 0).toFixed(1)} / 10 + + + + {featuredReview && ( + + + "{featuredReview.comment}" + + + + {!featuredReview.user_avatar && featuredReview.user.charAt(0)} + + — {featuredReview.user} + + + )} + + + + + + {/* Progress Indicators */} + + {topFlavors.map((_, i) => ( + setActiveIndex(i)} + sx={{ + width: activeIndex === i ? 24 : 8, + height: 8, + borderRadius: 4, + bgcolor: activeIndex === i ? 'primary.main' : 'divider', + cursor: 'pointer', + transition: 'all 0.3s ease' + }} + /> + ))} + + + )} + + {/* Recent Reviews - SIDE BY SIDE */} + {recentReviews.length > 0 && ( + + Community Voice + + {recentReviews.slice(0, 5).map(review => ( + + + + + {!review.user_avatar && review.user.charAt(0).toUpperCase()} + + {review.user} + + + + + + on {review.flavor_name} + + + "{review.comment}" + + + ))} + + + + )} + + {/* Newest Arrivals */} {newestFlavors.length > 0 && ( - + New Arrivals { gap: 2 }}> {newestFlavors.map(flavor => ( - + { )} - - {/* Recent Reviews */} - {recentReviews.length > 0 && ( - - Community Voice - - {recentReviews.map(review => ( - - - - - {!review.user_avatar && review.user.charAt(0).toUpperCase()} - - - - - {review.user} - - - on {review.flavor_name} - - - - - - {review.score}/10 - - "{review.comment}" - - ))} - - - )} );