From 595769ced05e808af3a188a319ee1d647539ed19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorem=20Ju=C3=A1rez?= Date: Fri, 26 Jun 2026 11:24:15 -0600 Subject: [PATCH] Remove the Palette tab from the editor The per-restaurant palette was retired in the redesign (menu colors are fixed), so the Palette editor tab no longer affected anything. Removed the tab and its PaletteTab component; the editor now has 4 tabs (Catalog, Brand, Orders, QR). The Restaurant.palette value is kept because the QR tab still uses it for its color templates. --- src/components/editor/Editor.tsx | 7 +- src/components/editor/PaletteTab.tsx | 114 --------------------------- 2 files changed, 2 insertions(+), 119 deletions(-) delete mode 100644 src/components/editor/PaletteTab.tsx diff --git a/src/components/editor/Editor.tsx b/src/components/editor/Editor.tsx index 97a3a66..8e22bb8 100644 --- a/src/components/editor/Editor.tsx +++ b/src/components/editor/Editor.tsx @@ -5,14 +5,13 @@ import { useTranslations } from 'next-intl'; import type { EditorData, EditorSection } from './types'; import LanguageSwitch from '@/components/LanguageSwitch'; import CatalogTab from './CatalogTab'; -import PaletteTab from './PaletteTab'; import BrandTab from './BrandTab'; import OrdersTab from './OrdersTab'; import QrTab from './QrTab'; import PublishModal from './PublishModal'; -import { ClipboardList, Palette, Store, Bell, QrCode, type LucideIcon } from 'lucide-react'; +import { ClipboardList, Store, Bell, QrCode, type LucideIcon } from 'lucide-react'; -type Tab = 'catalog' | 'palette' | 'brand' | 'orders' | 'qr'; +type Tab = 'catalog' | 'brand' | 'orders' | 'qr'; export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: string }) { const t = useTranslations('editor'); @@ -26,7 +25,6 @@ export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: s const tabs: { id: Tab; label: string; Icon: LucideIcon }[] = [ { id: 'catalog', label: t('catalog'), Icon: ClipboardList }, - { id: 'palette', label: t('palette'), Icon: Palette }, { id: 'brand', label: t('brand'), Icon: Store }, { id: 'orders', label: t('orders'), Icon: Bell }, { id: 'qr', label: t('qr'), Icon: QrCode }, @@ -56,7 +54,6 @@ export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: s onRestored={(name) => setPublishedName(name)} /> )} - {tab === 'palette' && } {tab === 'brand' && ( ({ - ...PALETTE_PRESETS[0].palette, - ...initialPalette, - }); - const [saving, setSaving] = useState(false); - const [saved, setSaved] = useState(false); - - function update(next: Palette) { - setPalette(next); - setSaved(false); - } - - async function save() { - setSaving(true); - try { - await api(slug, '/palette', { method: 'PATCH', json: { palette } }); - setSaved(true); - } finally { - setSaving(false); - } - } - - return ( -
- {/* Live preview */} -
-
-

- Vista previa -

- -
-
- - {/* Presets */} -
- {PALETTE_PRESETS.map((p) => ( - - ))} -
- - {/* Custom colors */} -
-
- {FIELDS.map((f) => ( - - ))} -
-
- -

⚠️ {t('paletteHint')}

- - -
- ); -}