From 6c7df8d0114969aa441c19f22a422d6950212b24 Mon Sep 17 00:00:00 2001 From: bonamin Date: Sun, 19 Jul 2026 11:16:18 +0300 Subject: [PATCH] =?UTF-8?q?fix(menu-app):=20replace=20EN|=CE=95=CE=9B=20pi?= =?UTF-8?q?ll=20with=20a=20compact=20globe=20icon=20+=20dropdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two-segment language pill sat over the header image/logo area and clipped it. Swapped for a small globe icon button tucked closer to the corner, opening a lightweight dropdown with full language names on tap. Co-Authored-By: Claude Sonnet 5 --- .../menu-app/src/pages/MenuPage.jsx | 66 ++++++++++++++----- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/connect_frontend/menu-app/src/pages/MenuPage.jsx b/connect_frontend/menu-app/src/pages/MenuPage.jsx index 651763c..7a76e34 100644 --- a/connect_frontend/menu-app/src/pages/MenuPage.jsx +++ b/connect_frontend/menu-app/src/pages/MenuPage.jsx @@ -4,7 +4,7 @@ import { Search, Leaf, X, Plus, ShoppingBag, ChevronLeft, ArrowRight, Send, Loader2, Info, Armchair, Check, SearchX, UtensilsCrossed, AlertCircle, - Soup, Salad, Wheat, IceCream2, Wine, + Soup, Salad, Wheat, IceCream2, Wine, Globe, } from 'lucide-react' import { fetchMenu, submitOrder, CLOUD_URL } from '../api' import { @@ -113,6 +113,53 @@ function SheetHandle() { ) } +// ── Language Switcher ──────────────────────────────────────────────────────── +const LANGS = [ + { code: 'en', label: 'English' }, + { code: 'gr', label: 'Ελληνικά' }, +] + +function LanguageSwitcher({ lang, setLang }) { + const [open, setOpen] = useState(false) + const ref = useRef(null) + + useEffect(() => { + if (!open) return + const onClickAway = e => { if (ref.current && !ref.current.contains(e.target)) setOpen(false) } + document.addEventListener('mousedown', onClickAway) + return () => document.removeEventListener('mousedown', onClickAway) + }, [open]) + + return ( +
+ + + {open && ( +
+ {LANGS.map(({ code, label }) => ( + + ))} +
+ )} +
+ ) +} + // ── Hero ────────────────────────────────────────────────────────────────────── function Hero({ lang, setLang, restaurant }) { const name = restaurant?.name || RESTAURANT_FALLBACK.name @@ -123,22 +170,7 @@ function Hero({ lang, setLang, restaurant }) { return (
- {/* Language toggle */} -
-
- {['en', 'gr'].map(l => ( - - ))} -
-
+ {headerImageUrl ? (