From d0aff29a713e99bf886bd1a485615c34dfa1857e Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Tue, 16 Jun 2026 18:51:25 +0200 Subject: [PATCH] removed stats --- .../components/home/DesktopHomeSections.tsx | 88 ------------------- .../components/layout/DesktopCategoryBar.tsx | 20 ++++- .../src/components/layout/DesktopTopBar.tsx | 2 +- frontend/src/components/ui/GlassAppBar.tsx | 15 +++- frontend/src/i18n.ts | 6 -- frontend/src/pages/MainPage.tsx | 12 +-- 6 files changed, 34 insertions(+), 109 deletions(-) diff --git a/frontend/src/components/home/DesktopHomeSections.tsx b/frontend/src/components/home/DesktopHomeSections.tsx index 421f102..d03961f 100644 --- a/frontend/src/components/home/DesktopHomeSections.tsx +++ b/frontend/src/components/home/DesktopHomeSections.tsx @@ -1,9 +1,6 @@ import { Link } from 'react-router-dom'; import { Box, Typography } from '@mui/material'; import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; -import EmojiEventsOutlinedIcon from '@mui/icons-material/EmojiEventsOutlined'; -import FiberNewOutlinedIcon from '@mui/icons-material/FiberNewOutlined'; -import CategoryOutlinedIcon from '@mui/icons-material/CategoryOutlined'; import { useTranslation } from 'react-i18next'; import { GlassCard, SectionHeader } from '../ui'; @@ -81,88 +78,3 @@ export const CategoryBrowseGrid = ({ categories }: CategoryBrowseGridProps) => { ); }; - -export interface QuickStatsStripProps { - topName?: string; - topScore?: number; - newestName?: string; - categoryCount: number; -} - -/** Desktop-only featured strip — fills the wider canvas with at-a-glance picks. */ -export const QuickStatsStrip = ({ - topName, - topScore, - newestName, - categoryCount, -}: QuickStatsStripProps) => { - const { t } = useTranslation(); - - const items = [ - { - icon: , - label: t('home.statTopRated', { defaultValue: 'Top Rated' }), - value: topName, - sub: topScore != null ? `${topScore.toFixed(1)} / 10` : undefined, - }, - { - icon: , - label: t('home.statNewest', { defaultValue: 'Newest Arrival' }), - value: newestName, - }, - { - icon: , - label: t('home.statCategories', { defaultValue: 'Categories' }), - value: String(categoryCount), - }, - ].filter((i) => i.value); - - if (items.length === 0) return null; - - return ( - - {items.map((item) => ( - - - {item.icon} - - - - {item.label} - - - {item.value} - - {item.sub && ( - - {item.sub} - - )} - - - ))} - - ); -}; diff --git a/frontend/src/components/layout/DesktopCategoryBar.tsx b/frontend/src/components/layout/DesktopCategoryBar.tsx index c5b955d..bfb516f 100644 --- a/frontend/src/components/layout/DesktopCategoryBar.tsx +++ b/frontend/src/components/layout/DesktopCategoryBar.tsx @@ -3,6 +3,7 @@ import { Box, Button, alpha } from '@mui/material'; import type { Theme } from '@mui/material'; import HomeOutlinedIcon from '@mui/icons-material/HomeOutlined'; import GroupsOutlinedIcon from '@mui/icons-material/GroupsOutlined'; +import CollectionsBookmarkOutlinedIcon from '@mui/icons-material/CollectionsBookmarkOutlined'; import { useTranslation } from 'react-i18next'; import { useAuth } from '../../hooks/useAuth'; @@ -66,7 +67,12 @@ export const DesktopCategoryBar = ({ categories }: DesktopCategoryBarProps) => { scrollbarWidth: 'none', }} > - @@ -78,6 +84,18 @@ export const DesktopCategoryBar = ({ categories }: DesktopCategoryBarProps) => { )} + {user && ( + + )} + { const unreadCount = user?.unread_notifications_count || 0; return ( - + diff --git a/frontend/src/components/ui/GlassAppBar.tsx b/frontend/src/components/ui/GlassAppBar.tsx index 5675176..831e39a 100644 --- a/frontend/src/components/ui/GlassAppBar.tsx +++ b/frontend/src/components/ui/GlassAppBar.tsx @@ -1,5 +1,6 @@ import { useEffect, useState, type ReactNode } from 'react'; import { styled, alpha } from '@mui/material/styles'; +import type { SxProps, Theme } from '@mui/material/styles'; import AppBar from '@mui/material/AppBar'; import Toolbar from '@mui/material/Toolbar'; @@ -24,9 +25,12 @@ const StyledAppBar = styled(AppBar, { export interface GlassAppBarProps { children: ReactNode; threshold?: number; + /** Extra styles merged onto the inner Toolbar — e.g. to constrain its content + * to the page-content column so the bar aligns with the main content edges. */ + toolbarSx?: SxProps; } -export const GlassAppBar = ({ children, threshold = 12 }: GlassAppBarProps) => { +export const GlassAppBar = ({ children, threshold = 12, toolbarSx }: GlassAppBarProps) => { const [scrolled, setScrolled] = useState(false); useEffect(() => { @@ -38,7 +42,14 @@ export const GlassAppBar = ({ children, threshold = 12 }: GlassAppBarProps) => { return ( - + + } + > {children} diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index ce3c280..fc48d54 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -116,9 +116,6 @@ const resources = { hallOfFameSubtitle: 'Highest-rated flavors in the archive', browseCategories: 'Browse Categories', browseCategoriesSubtitle: 'Jump straight into a flavor line', - statTopRated: 'Top Rated', - statNewest: 'Newest Arrival', - statCategories: 'Categories', recForYou: 'Recommended for You', recForYouSubtitle: 'Picked by tasters who share your palate', popularPicks: 'Popular Picks', @@ -652,9 +649,6 @@ const resources = { hallOfFameSubtitle: 'Die bestbewerteten Sorten im Archiv', browseCategories: 'Kategorien durchstöbern', browseCategoriesSubtitle: 'Direkt zu einer Sorten-Linie springen', - statTopRated: 'Bestbewertet', - statNewest: 'Neuheit', - statCategories: 'Kategorien', recForYou: 'Für dich empfohlen', recForYouSubtitle: 'Ausgewählt von Testern mit ähnlichem Geschmack', popularPicks: 'Beliebte Sorten', diff --git a/frontend/src/pages/MainPage.tsx b/frontend/src/pages/MainPage.tsx index 64ad0f3..98a84f9 100644 --- a/frontend/src/pages/MainPage.tsx +++ b/frontend/src/pages/MainPage.tsx @@ -35,7 +35,7 @@ import { EmptyState, } from '../components/ui'; import MainPageRecommendations from './MainPageRecommendations'; -import { CategoryBrowseGrid, QuickStatsStrip } from '../components/home/DesktopHomeSections'; +import { CategoryBrowseGrid } from '../components/home/DesktopHomeSections'; import { useCategories } from '../api/queries/useCategories'; const TOP_LIMIT = 5; @@ -274,16 +274,6 @@ const MainPage: React.FC = () => { )} - {/* Desktop-only featured strip — fills the wider canvas */} - {isDesktop && ( - - )} - {/* Hall of Fame */}