From 2bd7da083901e9eab7a925c0107ff667e4ada0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorem=20Ju=C3=A1rez?= Date: Mon, 15 Jun 2026 21:13:10 -0600 Subject: [PATCH] Remove macro color-code legend from the public menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'Código de color de macros' collapsible bar took prominent space for secondary info that's already self-explanatory on each card's back (full text labels like 'Proteína 19g' next to their color). Removed it from the toggle row in both views; the row is justify-end so the cards/list view toggle reflows cleanly with no gap. Dropped the now-unused MacroLegend component and the anyMacros computation. The macro text labels on the card backs are unchanged. Build passes. --- src/components/public/MacroLegend.tsx | 39 --------------------------- src/components/public/PublicMenu.tsx | 6 +---- 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 src/components/public/MacroLegend.tsx diff --git a/src/components/public/MacroLegend.tsx b/src/components/public/MacroLegend.tsx deleted file mode 100644 index 345cd7e..0000000 --- a/src/components/public/MacroLegend.tsx +++ /dev/null @@ -1,39 +0,0 @@ -'use client'; - -import { useState } from 'react'; -import { useTranslations } from 'next-intl'; -import { MACRO_COLORS, MACRO_KEYS } from '@/lib/macros'; - -// Collapsible accessible legend for the universal macro color code. -export default function MacroLegend() { - const t = useTranslations('macros'); - const tm = useTranslations('menu'); - const [open, setOpen] = useState(false); - - return ( -
- - {open && ( - - )} -
- ); -} diff --git a/src/components/public/PublicMenu.tsx b/src/components/public/PublicMenu.tsx index 4699582..16c1fc9 100644 --- a/src/components/public/PublicMenu.tsx +++ b/src/components/public/PublicMenu.tsx @@ -8,7 +8,6 @@ import { pickText } from '@/lib/text'; import BrandHeader from './BrandHeader'; import DishCard from './DishCard'; import ListRow from './ListRow'; -import MacroLegend from './MacroLegend'; import Gallery from './Gallery'; import AiConsultant from './AiConsultant'; import SuggestionCarousel from './SuggestionCarousel'; @@ -79,11 +78,9 @@ export default function PublicMenu({ menu, slug }: { menu: MenuSnapshot; slug: s const ordersEnabled = menu.restaurant.ordersEnabled; const splitEnabled = ordersEnabled && !!menu.restaurant.splitEnabled; - // Macros hierarchy: global flag AND the section's own flag. The legend appears - // only if at least one visible section actually shows macros. + // Macros hierarchy: shown only if the global flag AND the section's flag are on. const globalMacros = menu.restaurant.showMacros; const sectionShowsMacros = (s: { showMacros?: boolean }) => globalMacros && s.showMacros !== false; - const anyMacros = globalMacros && sections.some((s) => s.showMacros !== false); function scrollToSection(id: string) { setActiveSection(id); @@ -215,7 +212,6 @@ export default function PublicMenu({ menu, slug }: { menu: MenuSnapshot; slug: s {/* View toggle (cards vs traditional list). Not persisted. */}
- {anyMacros &&
}