Apply full frontend redesign (Montserrat, red accent, glass + dock UI)
Fonts switched to Montserrat (UI) + Merriweather (landing wordmark). Macro protein standard color updated to #dc2626; primary actions hardcoded red. New globals.css primitives: ai-smoke gradient buttons, seg-btn, sticky cat-bar, editor dock-*, macro shimmer, delivery-timer pulses, liquid-btn, aurora, editable-num. - Public: landing (video bg + red CTA), PublicMenu (segmented toggle + "Preguntar a Claude" + sticky category bar w/ scroll-spy + Order/Waiter/ Split FABs), DishCard flip, MacrosBack shimmer, BrandHeader, SplitPanel, AiConsultant. - Editor: bottom dock navigation, EditorLogin video background, BrandTab, CatalogTab (+SectionTitleEditor), VersionHistory, OrdersTab, ProductEditor. - Admin: AdminLogin, AdminPanel. - Add landing/editor background videos under public/videos. - ES/EN i18n keys added; FRONTEND.md updated; design mockups included. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
ceac688fa8
commit
58a71d0bef
42 files changed
+3665
-412
No files matched your search
+338
-2
@@ -21,7 +21,7 @@ body {
|
||||
|
||||
body {
|
||||
color: var(--text);
|
||||
font-family: var(--font-inter), system-ui, sans-serif;
|
||||
font-family: var(--font-montserrat), system-ui, sans-serif;
|
||||
background:
|
||||
radial-gradient(1200px 800px at 80% -10%, rgba(255, 255, 255, 0.6), transparent 60%),
|
||||
radial-gradient(1000px 700px at -10% 110%, rgba(255, 255, 255, 0.4), transparent 55%),
|
||||
@@ -55,7 +55,12 @@ body {
|
||||
}
|
||||
|
||||
.display {
|
||||
font-family: var(--font-fraunces), Georgia, serif;
|
||||
font-family: var(--font-montserrat), system-ui, sans-serif;
|
||||
}
|
||||
|
||||
/* Reserved for the landing "Smart Menu" wordmark. */
|
||||
.wordmark {
|
||||
font-family: var(--font-merriweather), Georgia, serif;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,6 +168,337 @@ body {
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
Redesign design-system primitives (ported from the mockups)
|
||||
============================================================ */
|
||||
|
||||
/* ---- Primary action color (hardcoded red across restaurants) ---- */
|
||||
:root {
|
||||
--action: #dc2626;
|
||||
}
|
||||
|
||||
/* ---- "Liquid glass" button (opt-in via .liquid-btn) ---- */
|
||||
.liquid-btn {
|
||||
position: relative;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(255, 255, 255, 0.65), rgba(245, 242, 237, 0.25) 55%, rgba(180, 83, 9, 0.06)),
|
||||
rgba(255, 255, 255, 0.4);
|
||||
backdrop-filter: blur(10px) saturate(160%);
|
||||
-webkit-backdrop-filter: blur(10px) saturate(160%);
|
||||
border: 1px solid rgba(255, 255, 255, 0.9);
|
||||
box-shadow:
|
||||
0 10px 24px -6px rgba(40, 30, 20, 0.22),
|
||||
0 2px 6px rgba(40, 30, 20, 0.1),
|
||||
inset 0 2px 2px rgba(255, 255, 255, 1),
|
||||
inset 0 -6px 12px rgba(180, 160, 140, 0.18),
|
||||
inset 0 0 0 1px rgba(255, 255, 255, 0.5);
|
||||
overflow: hidden;
|
||||
color: #2a2520;
|
||||
transition: box-shadow 0.25s ease, transform 0.25s ease;
|
||||
}
|
||||
.liquid-btn::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 6%;
|
||||
right: 6%;
|
||||
top: 2px;
|
||||
height: 42%;
|
||||
border-radius: 999px;
|
||||
pointer-events: none;
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
|
||||
filter: blur(0.5px);
|
||||
opacity: 0.9;
|
||||
}
|
||||
.liquid-btn:hover {
|
||||
box-shadow:
|
||||
0 14px 30px -6px rgba(40, 30, 20, 0.28),
|
||||
0 3px 8px rgba(40, 30, 20, 0.14),
|
||||
inset 0 2px 3px rgba(255, 255, 255, 1),
|
||||
inset 0 -7px 14px rgba(180, 160, 140, 0.22),
|
||||
inset 0 0 0 1px rgba(255, 255, 255, 0.6);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* ---- Animated gradient "smoke" buttons (AI / order / split) ---- */
|
||||
@keyframes ai-smoke {
|
||||
0% { background-position: 0% 50%; }
|
||||
50% { background-position: 100% 50%; }
|
||||
100% { background-position: 0% 50%; }
|
||||
}
|
||||
.ai-smoke,
|
||||
.ai-smoke-red,
|
||||
.ai-smoke-green {
|
||||
background-size: 300% 300%;
|
||||
color: #fff;
|
||||
border: none;
|
||||
animation: ai-smoke 6s ease-in-out infinite;
|
||||
}
|
||||
.ai-smoke { background-image: linear-gradient(120deg, #d97757, #e89b7d, #c2410c, #e08a5f, #d97757); }
|
||||
.ai-smoke-red { background-image: linear-gradient(120deg, #dc2626, #f05252, #991b1b, #ef4444, #dc2626); }
|
||||
.ai-smoke-green { background-image: linear-gradient(120deg, #4c1d95, #6d28d9, #3b0764, #5b21b6, #4c1d95); }
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ai-smoke,
|
||||
.ai-smoke-red,
|
||||
.ai-smoke-green { animation: none; }
|
||||
}
|
||||
|
||||
/* ---- Segmented control (e.g. Tarjetas / Lista) ---- */
|
||||
.seg-btn {
|
||||
color: rgba(42, 37, 32, 0.5);
|
||||
background: transparent;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
.seg-btn.is-active {
|
||||
color: #111;
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 8px rgba(40, 30, 20, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
/* ---- Category pills + sticky "stuck" bar (public menu sections) ---- */
|
||||
.cat-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
background: #f0f0f0;
|
||||
color: #111;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s ease, color 0.2s ease;
|
||||
}
|
||||
.cat-btn.is-active {
|
||||
background: #111;
|
||||
color: #fff;
|
||||
}
|
||||
.cat-bar {
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition: box-shadow 0.25s ease, background 0.25s ease;
|
||||
}
|
||||
.cat-bar.is-stuck {
|
||||
box-shadow: 0 6px 16px -6px rgba(40, 30, 20, 0.18), 0 1px 0 rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
.cat-row {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.stuck-name {
|
||||
display: none;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
color: #111;
|
||||
margin-bottom: 12px;
|
||||
padding-left: 2px;
|
||||
}
|
||||
.cat-bar.is-stuck .stuck-name { display: block; }
|
||||
.cat-bar.is-stuck .cat-row { justify-content: flex-start; gap: 22px; }
|
||||
.cat-bar.is-stuck .cat-btn {
|
||||
background: transparent !important;
|
||||
color: rgba(42, 37, 32, 0.45) !important;
|
||||
border-radius: 0 !important;
|
||||
padding: 0 0 9px !important;
|
||||
position: relative;
|
||||
font-weight: 600;
|
||||
}
|
||||
.cat-bar.is-stuck .cat-btn.is-active { background: transparent !important; color: #111 !important; }
|
||||
.cat-bar.is-stuck .cat-btn.is-active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 3px;
|
||||
border-radius: 3px;
|
||||
background: #111;
|
||||
}
|
||||
|
||||
/* ---- Editor bottom dock navigation ---- */
|
||||
.dock-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 4px;
|
||||
width: 100%;
|
||||
padding: 20px 18px 14px;
|
||||
border-radius: 32px;
|
||||
background: #fff;
|
||||
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||
box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
.dock-btn {
|
||||
flex: 1 1 0;
|
||||
height: 46px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
}
|
||||
.dock-chip {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
border-radius: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #1b1916;
|
||||
transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.5, 1), background 0.25s, box-shadow 0.25s;
|
||||
}
|
||||
.dock-btn:hover .dock-chip { transform: translateY(-3px); }
|
||||
.dock-btn.is-active .dock-chip {
|
||||
background: #ececec;
|
||||
transform: translateY(-12px) scale(1.06);
|
||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
.dock-dot {
|
||||
position: absolute;
|
||||
bottom: -4px;
|
||||
left: 50%;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 999px;
|
||||
background: #111;
|
||||
transform: translateX(-50%) scale(0);
|
||||
transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.5, 1);
|
||||
}
|
||||
.dock-btn.is-active .dock-dot { transform: translateX(-50%) scale(1); }
|
||||
.dock-tip {
|
||||
position: absolute;
|
||||
bottom: calc(100% + 6px);
|
||||
left: 50%;
|
||||
padding: 7px 16px;
|
||||
border-radius: 14px;
|
||||
background: #fff;
|
||||
color: #1b1916;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
opacity: 0;
|
||||
transform: translateX(-50%) translateY(6px) scale(0.95);
|
||||
transition: opacity 0.2s, transform 0.2s;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.dock-btn:hover .dock-tip { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
|
||||
|
||||
/* ---- Macro grid (back of dish card) + shimmering numbers ---- */
|
||||
.macro-cell {
|
||||
background: #fff;
|
||||
border: 1px solid rgba(0, 0, 0, 0.04);
|
||||
box-shadow: 0 1px 3px rgba(40, 30, 20, 0.06);
|
||||
}
|
||||
@keyframes macro-shine {
|
||||
0% { background-position: 250% 0; }
|
||||
100% { background-position: -150% 0; }
|
||||
}
|
||||
.macro-num {
|
||||
background-image: linear-gradient(
|
||||
100deg,
|
||||
var(--c) 0%,
|
||||
var(--c) 42%,
|
||||
color-mix(in srgb, var(--c) 35%, #ffffff) 50%,
|
||||
var(--c) 58%,
|
||||
var(--c) 100%
|
||||
);
|
||||
background-size: 250% 100%;
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
color: transparent;
|
||||
animation: macro-shine 5.5s linear infinite;
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.macro-num { animation: none; }
|
||||
}
|
||||
|
||||
/* ---- Order delivery-timer pulses (editor orders) ---- */
|
||||
@keyframes pendiente-pulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 rgba(40, 189, 28, 0); }
|
||||
50% { box-shadow: 0 0 0 4px rgba(40, 189, 28, 0.5); }
|
||||
}
|
||||
@keyframes pendiente-pulse-yellow {
|
||||
0%, 100% { box-shadow: 0 0 0 0 rgba(224, 189, 58, 0); }
|
||||
50% { box-shadow: 0 0 0 4px rgba(224, 189, 58, 0.5); }
|
||||
}
|
||||
@keyframes pendiente-pulse-red {
|
||||
0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
|
||||
50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.5); }
|
||||
}
|
||||
.pendiente-green {
|
||||
background: #28bd1c;
|
||||
color: #fff;
|
||||
border: 1px solid #1f9416;
|
||||
animation: pendiente-pulse 1.2s ease-in-out infinite;
|
||||
}
|
||||
.pendiente-yellow {
|
||||
background: #fce167;
|
||||
color: #4a3c00;
|
||||
border: 1px solid #e0bd3a;
|
||||
animation: pendiente-pulse-yellow 1.2s ease-in-out infinite;
|
||||
}
|
||||
.pendiente-red {
|
||||
background: #ef4444;
|
||||
color: #fff;
|
||||
border: 1px solid #991b1b;
|
||||
animation: pendiente-pulse-red 1.2s ease-in-out infinite;
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pendiente-green,
|
||||
.pendiente-yellow,
|
||||
.pendiente-red { animation: none; }
|
||||
}
|
||||
|
||||
/* ---- Numeric inputs without spinner (editor thresholds) ---- */
|
||||
.editable-num {
|
||||
-moz-appearance: textfield;
|
||||
appearance: textfield;
|
||||
}
|
||||
.editable-num::-webkit-outer-spin-button,
|
||||
.editable-num::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ---- Aurora background (landing) ---- */
|
||||
.aurora {
|
||||
--white-gradient: repeating-linear-gradient(100deg, #fff 0%, #fff 7%, transparent 10%, transparent 12%, #fff 16%);
|
||||
--aurora: repeating-linear-gradient(100deg, #3b82f6 10%, #a5b4fc 15%, #93c5fd 20%, #ddd6fe 25%, #60a5fa 30%);
|
||||
position: absolute;
|
||||
inset: -10px;
|
||||
pointer-events: none;
|
||||
opacity: 0.5;
|
||||
will-change: transform;
|
||||
background-image: var(--white-gradient), var(--aurora);
|
||||
background-size: 300% 200%;
|
||||
background-position: 50% 50%, 50% 50%;
|
||||
filter: blur(10px) invert(1);
|
||||
-webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 70%);
|
||||
mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 70%);
|
||||
}
|
||||
.aurora::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image: var(--white-gradient), var(--aurora);
|
||||
background-size: 200% 100%;
|
||||
background-attachment: fixed;
|
||||
mix-blend-mode: difference;
|
||||
animation: aurora 60s linear infinite;
|
||||
}
|
||||
@keyframes aurora {
|
||||
from { background-position: 50% 50%, 50% 50%; }
|
||||
to { background-position: 350% 50%, 350% 50%; }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.aurora::after { animation: none; }
|
||||
}
|
||||
|
||||
/* Safe-area helpers for edge-to-edge layout (viewport-fit=cover).
|
||||
The background covers behind the notch / dynamic island and gesture bar, while
|
||||
interactive content is padded so it isn't covered. On devices without insets
|
||||
|
||||
+9
-6
@@ -1,17 +1,20 @@
|
||||
import type { Metadata, Viewport } from 'next';
|
||||
import { Fraunces, Inter } from 'next/font/google';
|
||||
import { Montserrat, Merriweather } from 'next/font/google';
|
||||
import { NextIntlClientProvider } from 'next-intl';
|
||||
import { getLocale, getMessages } from 'next-intl/server';
|
||||
import './globals.css';
|
||||
|
||||
const fraunces = Fraunces({
|
||||
// Montserrat drives all UI + display type; Merriweather is reserved for the
|
||||
// landing "Smart Menu" wordmark.
|
||||
const montserrat = Montserrat({
|
||||
subsets: ['latin'],
|
||||
variable: '--font-fraunces',
|
||||
variable: '--font-montserrat',
|
||||
display: 'swap',
|
||||
});
|
||||
const inter = Inter({
|
||||
const merriweather = Merriweather({
|
||||
subsets: ['latin'],
|
||||
variable: '--font-inter',
|
||||
weight: ['300', '400', '700', '900'],
|
||||
variable: '--font-merriweather',
|
||||
display: 'swap',
|
||||
});
|
||||
|
||||
@@ -39,7 +42,7 @@ export default async function RootLayout({
|
||||
const messages = await getMessages();
|
||||
|
||||
return (
|
||||
<html lang={locale} className={`${fraunces.variable} ${inter.variable}`}>
|
||||
<html lang={locale} className={`${montserrat.variable} ${merriweather.variable}`}>
|
||||
<body>
|
||||
<NextIntlClientProvider locale={locale} messages={messages}>
|
||||
{children}
|
||||
|
||||
+27
-63
@@ -1,49 +1,25 @@
|
||||
import Link from 'next/link';
|
||||
|
||||
// 4-point "magic" sparkle.
|
||||
function Sparkle({
|
||||
className,
|
||||
style,
|
||||
color,
|
||||
size,
|
||||
}: {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
color: string;
|
||||
size: number;
|
||||
}) {
|
||||
return (
|
||||
<svg
|
||||
aria-hidden
|
||||
width={size}
|
||||
height={size}
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
className={className}
|
||||
style={style}
|
||||
>
|
||||
<path
|
||||
d="M12 0c.6 6 2.4 9 12 12-9.6 3-11.4 6-12 12-.6-6-2.4-9-12-12C9.6 9 11.4 6 12 0Z"
|
||||
fill={color}
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
// Sparkles scattered around the "by Collina" signature.
|
||||
const SPARKLES: { top: string; left: string; size: number; color: string; delay: string }[] = [
|
||||
{ top: '-18px', left: '-6%', size: 16, color: '#f59e0b', delay: '0.7s' },
|
||||
{ top: '4px', left: '102%', size: 20, color: '#fb7185', delay: '1.0s' },
|
||||
{ top: '34px', left: '8%', size: 12, color: '#fcd34d', delay: '1.4s' },
|
||||
{ top: '40px', left: '88%', size: 14, color: '#d97706', delay: '0.9s' },
|
||||
{ top: '-10px', left: '52%', size: 10, color: '#fbbf24', delay: '1.7s' },
|
||||
{ top: '24px', left: '-2%', size: 9, color: '#fda4af', delay: '2.1s' },
|
||||
{ top: '-2px', left: '78%', size: 11, color: '#f59e0b', delay: '1.2s' },
|
||||
];
|
||||
|
||||
// Landing premium minimalista: video de fondo + wordmark "Smart Menu" + CTA único.
|
||||
export default function Home() {
|
||||
return (
|
||||
<main className="relative flex min-h-screen flex-col items-center justify-center overflow-hidden px-6 text-center">
|
||||
<main
|
||||
className="relative flex min-h-screen flex-col items-center justify-center overflow-hidden px-6 text-center"
|
||||
style={{ background: '#1b1916' }}
|
||||
>
|
||||
{/* Background video */}
|
||||
<video
|
||||
className="absolute inset-0 h-full w-full object-cover"
|
||||
autoPlay
|
||||
muted
|
||||
loop
|
||||
playsInline
|
||||
preload="auto"
|
||||
aria-hidden
|
||||
>
|
||||
<source src="/videos/landing-bg.mp4" type="video/mp4" />
|
||||
</video>
|
||||
|
||||
{/* Soft brand glow behind the wordmark */}
|
||||
<div
|
||||
aria-hidden
|
||||
@@ -55,29 +31,20 @@ export default function Home() {
|
||||
/>
|
||||
|
||||
<div className="relative flex flex-col items-center">
|
||||
{/* SmartMenu — the protagonist */}
|
||||
<h1 className="lp-smart text-5xl font-extrabold tracking-tight sm:text-7xl">
|
||||
<span className="text-[var(--text)]">Smart</span>
|
||||
<span className="text-[var(--accent)]">Menu</span>
|
||||
{/* SmartMenu — the protagonist (Merriweather wordmark) */}
|
||||
<h1 className="lp-smart wordmark text-5xl font-extrabold tracking-tight text-white sm:text-7xl">
|
||||
<span>Smart </span>
|
||||
<span className="text-white/80">Menu</span>
|
||||
</h1>
|
||||
|
||||
{/* by Collina — delicate signature + sparkles. Tapping it opens /admin. */}
|
||||
{/* by Collina — tapping it opens /admin. */}
|
||||
<div className="lp-sign relative mt-4">
|
||||
{SPARKLES.map((s, i) => (
|
||||
<Sparkle
|
||||
key={i}
|
||||
className="lp-sparkle pointer-events-none absolute"
|
||||
style={{ top: s.top, left: s.left, animationDelay: s.delay }}
|
||||
color={s.color}
|
||||
size={s.size}
|
||||
/>
|
||||
))}
|
||||
<Link
|
||||
href="/admin"
|
||||
aria-label="Collina"
|
||||
className="display relative select-none text-lg font-light italic text-[var(--text)]/55 transition hover:text-[var(--text)]/80"
|
||||
className="display relative select-none text-lg font-light italic text-white/55 transition hover:text-white/80"
|
||||
>
|
||||
by Collina
|
||||
by Collina Systems
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,14 +52,11 @@ export default function Home() {
|
||||
{/* Single sales CTA */}
|
||||
<Link
|
||||
href="/demo"
|
||||
className="lp-cta mt-14 rounded-full bg-[var(--accent)] px-8 py-4 text-sm font-semibold tracking-wide text-white shadow-lg shadow-[var(--accent)]/20 transition hover:-translate-y-0.5 hover:shadow-xl"
|
||||
className="lp-cta mt-14 rounded-full px-8 py-4 text-sm font-semibold tracking-wide text-white shadow-lg transition hover:-translate-y-0.5 hover:shadow-xl"
|
||||
style={{ background: '#dc2626', boxShadow: '0 10px 30px -8px rgba(220,38,38,.4)' }}
|
||||
>
|
||||
Solicita una demo
|
||||
</Link>
|
||||
|
||||
<p className="lp-cta mt-6 max-w-xs text-xs text-[var(--text)]/45">
|
||||
Menús digitales que entienden a tus comensales.
|
||||
</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -2,9 +2,12 @@
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
export default function AdminLogin() {
|
||||
const router = useRouter();
|
||||
const tAdmin = useTranslations('admin');
|
||||
const tAuth = useTranslations('auth');
|
||||
const [user, setUser] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [error, setError] = useState(false);
|
||||
@@ -27,26 +30,26 @@ export default function AdminLogin() {
|
||||
return (
|
||||
<main className="flex min-h-screen items-center justify-center p-4">
|
||||
<form onSubmit={submit} className="glass flex w-full max-w-sm flex-col gap-3 rounded-3xl p-6">
|
||||
<h1 className="display text-2xl font-semibold">Panel maestro Collina</h1>
|
||||
<h1 className="display text-2xl font-semibold">{tAdmin('title')}</h1>
|
||||
<input
|
||||
value={user}
|
||||
onChange={(e) => setUser(e.target.value)}
|
||||
placeholder="usuario"
|
||||
placeholder={tAuth('username')}
|
||||
className="glass-soft rounded-2xl px-4 py-3 outline-none"
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
placeholder="contraseña"
|
||||
placeholder={tAuth('password')}
|
||||
className="glass-soft rounded-2xl px-4 py-3 outline-none"
|
||||
/>
|
||||
{error && <p className="text-sm text-red-600">Credenciales incorrectas</p>}
|
||||
{error && <p className="text-sm text-red-600">{tAuth('invalid')}</p>}
|
||||
<button
|
||||
disabled={loading}
|
||||
className="rounded-2xl bg-[var(--accent)] py-3 font-medium text-white disabled:opacity-50"
|
||||
className="rounded-2xl bg-[#dc2626] py-3 font-medium text-white disabled:opacity-50"
|
||||
>
|
||||
Iniciar sesión
|
||||
{tAuth('login')}
|
||||
</button>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
type Restaurant = {
|
||||
id: string;
|
||||
@@ -27,6 +28,7 @@ export default function AdminPanel({
|
||||
initialRestaurants: Restaurant[];
|
||||
baseUrl: string;
|
||||
}) {
|
||||
const t = useTranslations('admin');
|
||||
const [restaurants, setRestaurants] = useState(initialRestaurants);
|
||||
const [name, setName] = useState('');
|
||||
const [slug, setSlug] = useState('');
|
||||
@@ -74,64 +76,64 @@ export default function AdminPanel({
|
||||
|
||||
return (
|
||||
<main className="mx-auto max-w-3xl p-4 pb-16">
|
||||
<h1 className="display mb-6 text-3xl font-semibold">Panel maestro Collina</h1>
|
||||
<h1 className="display mb-6 text-3xl font-semibold">{t('title')}</h1>
|
||||
|
||||
<section className="glass mb-6 rounded-3xl p-5">
|
||||
<h2 className="display mb-3 text-xl font-semibold">Nuevo restaurante</h2>
|
||||
<h2 className="display mb-3 text-center text-xl font-semibold">{t('newRestaurant')}</h2>
|
||||
<form onSubmit={create} className="flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-end">
|
||||
<label className="flex flex-1 flex-col gap-1 text-sm">
|
||||
Nombre
|
||||
<label className="flex flex-1 flex-col gap-1 text-center text-sm">
|
||||
{t('name')}
|
||||
<input
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
className="glass-soft rounded-2xl px-4 py-2.5 outline-none"
|
||||
/>
|
||||
</label>
|
||||
<label className="flex flex-1 flex-col gap-1 text-sm">
|
||||
Slug (opcional)
|
||||
<label className="flex flex-1 flex-col gap-1 text-center text-sm">
|
||||
{t('slugOptional')}
|
||||
<input
|
||||
value={slug}
|
||||
onChange={(e) => setSlug(e.target.value)}
|
||||
placeholder="se genera del nombre"
|
||||
placeholder={t('slugPlaceholder')}
|
||||
className="glass-soft rounded-2xl px-4 py-2.5 outline-none"
|
||||
/>
|
||||
</label>
|
||||
<label className="flex flex-col gap-1 text-sm">
|
||||
Idioma
|
||||
{t('language')}
|
||||
<select
|
||||
value={defaultLocale}
|
||||
onChange={(e) => setDefaultLocale(e.target.value)}
|
||||
className="glass-soft rounded-2xl px-4 py-2.5 outline-none"
|
||||
>
|
||||
<option value="es">ES</option>
|
||||
<option value="en">EN</option>
|
||||
<option value="es">{t('localeEs')}</option>
|
||||
<option value="en">{t('localeEn')}</option>
|
||||
</select>
|
||||
</label>
|
||||
<button
|
||||
disabled={creating}
|
||||
className="rounded-2xl bg-[var(--accent)] px-5 py-2.5 font-medium text-white disabled:opacity-50"
|
||||
className="solid-btn rounded-2xl bg-[#dc2626] px-5 py-2.5 font-medium text-white disabled:opacity-50"
|
||||
>
|
||||
Crear restaurante
|
||||
{t('create')}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{justCreated && (
|
||||
<div className="mt-4 rounded-2xl border border-amber-300 bg-amber-50/70 p-4 text-sm">
|
||||
<p className="mb-2 font-semibold">
|
||||
Restaurante «{justCreated.name}» creado. Guarda estas credenciales (se muestran una vez):
|
||||
{t('createdNotice', { name: justCreated.name })}
|
||||
</p>
|
||||
<ul className="space-y-1">
|
||||
<li>
|
||||
<strong>Usuario:</strong> {justCreated.username}
|
||||
<strong>{t('username')}:</strong> {justCreated.username}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Contraseña:</strong> <code>{justCreated.password}</code>
|
||||
<strong>{t('password')}:</strong> <code>{justCreated.password}</code>
|
||||
</li>
|
||||
<li className="break-all">
|
||||
<strong>Link de editor:</strong> {editorLink(justCreated)}
|
||||
<strong>{t('editorLink')}:</strong> {editorLink(justCreated)}
|
||||
</li>
|
||||
<li className="break-all">
|
||||
<strong>Link público:</strong> {publicLink(justCreated.slug)}
|
||||
<strong>{t('publicLink')}:</strong> {publicLink(justCreated.slug)}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -139,9 +141,11 @@ export default function AdminPanel({
|
||||
</section>
|
||||
|
||||
<section className="glass rounded-3xl p-5">
|
||||
<h2 className="display mb-3 text-xl font-semibold">Restaurantes</h2>
|
||||
<h2 className="display mb-3 text-xl font-semibold">{t('restaurants')}</h2>
|
||||
<div className="flex flex-col gap-3">
|
||||
{restaurants.length === 0 && <p className="text-sm text-[var(--text)]/60">Aún no hay restaurantes.</p>}
|
||||
{restaurants.length === 0 && (
|
||||
<p className="text-sm text-[var(--text)]/60">{t('empty')}</p>
|
||||
)}
|
||||
{restaurants.map((r) => (
|
||||
<div key={r.id} className="glass-soft rounded-2xl p-4">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
@@ -151,19 +155,19 @@ export default function AdminPanel({
|
||||
</div>
|
||||
<button
|
||||
onClick={() => toggleActive(r)}
|
||||
className={`rounded-full px-3 py-1 text-xs font-medium ${
|
||||
className={`solid-btn rounded-full px-3 py-1 text-xs font-medium ${
|
||||
r.active ? 'bg-green-100 text-green-800' : 'bg-gray-200 text-gray-600'
|
||||
}`}
|
||||
>
|
||||
{r.active ? 'activo' : 'inactivo'}
|
||||
{r.active ? t('statusActive') : t('statusInactive')}
|
||||
</button>
|
||||
</div>
|
||||
<div className="mt-2 space-y-1 text-xs">
|
||||
<a href={publicLink(r.slug)} target="_blank" className="block break-all text-[var(--accent)]">
|
||||
público: {publicLink(r.slug)}
|
||||
<a href={publicLink(r.slug)} target="_blank" className="block break-all text-[#dc2626]">
|
||||
{t('publicPrefix')}: {publicLink(r.slug)}
|
||||
</a>
|
||||
<a href={editorLink(r)} target="_blank" className="block break-all text-[var(--accent)]">
|
||||
editor: {editorLink(r)}
|
||||
<a href={editorLink(r)} target="_blank" className="block break-all text-[#dc2626]">
|
||||
{t('editorPrefix')}: {editorLink(r)}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -103,12 +103,15 @@ export default function BrandTab({
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-2 flex gap-2">
|
||||
<label className="glass-pill cursor-pointer rounded-full px-4 py-2 text-sm font-medium">
|
||||
<label className="cursor-pointer rounded-full bg-black px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-black/90">
|
||||
{uploading === 'banner' ? '…' : t('uploadBanner')}
|
||||
<input type="file" accept="image/*" hidden onChange={(e) => upload('banner', e.target.files?.[0] ?? null)} />
|
||||
</label>
|
||||
{banner && (
|
||||
<button onClick={() => setBanner(null)} className="rounded-full px-3 py-2 text-sm text-red-500/80">
|
||||
<button
|
||||
onClick={() => setBanner(null)}
|
||||
className="rounded-full bg-black/[0.06] px-4 py-2 text-sm font-medium text-red-500 transition-colors hover:bg-black/[0.1]"
|
||||
>
|
||||
{tc('delete')}
|
||||
</button>
|
||||
)}
|
||||
@@ -128,12 +131,15 @@ export default function BrandTab({
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
<label className="glass-pill cursor-pointer rounded-full px-4 py-2 text-sm font-medium">
|
||||
<label className="cursor-pointer self-start rounded-full bg-black px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-black/90">
|
||||
{uploading === 'profile' ? '…' : t('uploadLogo')}
|
||||
<input type="file" accept="image/*" hidden onChange={(e) => upload('profile', e.target.files?.[0] ?? null)} />
|
||||
</label>
|
||||
{profile && (
|
||||
<button onClick={() => setProfile(null)} className="text-left text-sm text-red-500/80">
|
||||
<button
|
||||
onClick={() => setProfile(null)}
|
||||
className="self-start rounded-full bg-black/[0.06] px-4 py-2 text-sm font-medium text-red-500 transition-colors hover:bg-black/[0.1]"
|
||||
>
|
||||
{tc('delete')}
|
||||
</button>
|
||||
)}
|
||||
@@ -149,7 +155,7 @@ export default function BrandTab({
|
||||
<button
|
||||
key={p}
|
||||
onClick={() => addLink(p)}
|
||||
className="glass-soft rounded-full px-3 py-1 text-xs"
|
||||
className="rounded-full border border-black/[0.06] bg-white/55 px-3 py-1 text-xs text-[var(--text)]/70 transition-colors hover:bg-white/80"
|
||||
>
|
||||
+ {p}
|
||||
</button>
|
||||
@@ -174,13 +180,16 @@ export default function BrandTab({
|
||||
invalid ? 'ring-1 ring-red-400' : ''
|
||||
}`}
|
||||
/>
|
||||
<button onClick={() => removeLink(i)} className="px-1 text-red-500/70" aria-label={tc('delete')}>
|
||||
<button onClick={() => removeLink(i)} className="px-1 text-red-500" aria-label={tc('delete')}>
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<button onClick={() => addLink()} className="glass-pill rounded-2xl py-2 text-sm font-medium">
|
||||
<button
|
||||
onClick={() => addLink()}
|
||||
className="rounded-2xl bg-black py-2 text-sm font-medium text-white transition-colors hover:bg-black/90"
|
||||
>
|
||||
+ {t('addLink')}
|
||||
</button>
|
||||
</div>
|
||||
@@ -189,7 +198,7 @@ export default function BrandTab({
|
||||
<button
|
||||
onClick={save}
|
||||
disabled={saving}
|
||||
className="rounded-2xl bg-[var(--accent)] py-3 font-medium text-white disabled:opacity-50"
|
||||
className="rounded-2xl bg-[#dc2626] py-3 font-medium text-white transition-colors hover:bg-[#dc2626]/90 disabled:opacity-50"
|
||||
>
|
||||
{saved ? '✓ ' : ''}
|
||||
{tc('save')}
|
||||
|
||||
@@ -158,19 +158,22 @@ export default function CatalogTab({
|
||||
<a
|
||||
href={`/${slug}`}
|
||||
target="_blank"
|
||||
className="glass-pill rounded-full px-4 py-2 text-sm font-medium"
|
||||
className="glass-pill rounded-full px-4 py-2 text-center text-sm font-medium"
|
||||
style={{ backgroundColor: 'rgba(179, 203, 232, 0.45)' }}
|
||||
>
|
||||
👁 {t('viewMenu')}
|
||||
</a>
|
||||
<button
|
||||
onClick={() => setImportOpen(true)}
|
||||
className="glass-pill rounded-full px-4 py-2 text-sm font-medium"
|
||||
className="rounded-full px-4 py-2 text-sm font-medium"
|
||||
style={{ backgroundColor: 'rgba(179, 203, 232, 0.45)' }}
|
||||
>
|
||||
✨ {ti('loadMenu')}
|
||||
</button>
|
||||
<button
|
||||
onClick={onPublish}
|
||||
className="ml-auto rounded-full bg-[var(--accent)] px-5 py-2 text-sm font-semibold text-white shadow"
|
||||
className="ml-auto rounded-full px-5 py-2 text-sm font-semibold text-white shadow"
|
||||
style={{ backgroundColor: '#dc2626' }}
|
||||
>
|
||||
{t('saveAndPublish')}
|
||||
</button>
|
||||
@@ -179,7 +182,7 @@ export default function CatalogTab({
|
||||
{/* Global macros toggle — lives here with catalog assembly (near Cargar menú) */}
|
||||
<div className="glass flex items-center justify-between gap-3 rounded-3xl p-4">
|
||||
<div className="min-w-0">
|
||||
<div className="text-sm font-medium">{t('showMacros')}</div>
|
||||
<div className="text-left text-sm font-medium">{t('showMacros')}</div>
|
||||
<div className="text-xs text-[var(--text)]/55">
|
||||
{showMacros ? t('showMacrosHint') : t('showMacrosDisclaimer')}
|
||||
</div>
|
||||
@@ -188,7 +191,7 @@ export default function CatalogTab({
|
||||
onClick={toggleGlobalMacros}
|
||||
aria-pressed={showMacros}
|
||||
className={`relative h-7 w-12 shrink-0 rounded-full transition ${
|
||||
showMacros ? 'bg-green-500' : 'bg-gray-300'
|
||||
showMacros ? 'bg-black' : 'bg-gray-300'
|
||||
}`}
|
||||
>
|
||||
<span
|
||||
@@ -239,7 +242,7 @@ export default function CatalogTab({
|
||||
<span className="text-[var(--text)]/70">{t('sectionMacros')}</span>
|
||||
<span
|
||||
className={`relative h-5 w-9 shrink-0 rounded-full transition ${
|
||||
s.showMacros ? 'bg-green-500' : 'bg-gray-300'
|
||||
s.showMacros ? 'bg-black' : 'bg-gray-300'
|
||||
}`}
|
||||
>
|
||||
<span
|
||||
@@ -308,7 +311,7 @@ export default function CatalogTab({
|
||||
|
||||
<button
|
||||
onClick={() => addProduct(s.id)}
|
||||
className="mt-3 w-full rounded-2xl border border-dashed border-[var(--accent)]/40 py-2 text-sm font-medium text-[var(--accent)]"
|
||||
className="mt-3 w-full rounded-2xl bg-black py-2 text-sm font-medium text-white"
|
||||
>
|
||||
+ {t('addDish')}
|
||||
</button>
|
||||
@@ -317,7 +320,8 @@ export default function CatalogTab({
|
||||
|
||||
<button
|
||||
onClick={addSection}
|
||||
className="glass-pill rounded-2xl py-3 text-sm font-medium"
|
||||
className="rounded-2xl py-3 text-sm font-medium text-white"
|
||||
style={{ backgroundColor: '#1e3a5f' }}
|
||||
>
|
||||
+ {t('newSection')}
|
||||
</button>
|
||||
|
||||
@@ -10,6 +10,7 @@ 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';
|
||||
|
||||
type Tab = 'catalog' | 'palette' | 'brand' | 'orders' | 'qr';
|
||||
|
||||
@@ -23,12 +24,12 @@ export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: s
|
||||
const [publishOpen, setPublishOpen] = useState(false);
|
||||
const [publishedName, setPublishedName] = useState(data.publishedVersionName);
|
||||
|
||||
const tabs: { id: Tab; label: string; icon: string }[] = [
|
||||
{ id: 'catalog', label: t('catalog'), icon: '📋' },
|
||||
{ id: 'palette', label: t('palette'), icon: '🎨' },
|
||||
{ id: 'brand', label: t('brand'), icon: '🏷️' },
|
||||
{ id: 'orders', label: t('orders'), icon: '🔔' },
|
||||
{ id: 'qr', label: t('qr'), icon: '🔳' },
|
||||
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 },
|
||||
];
|
||||
|
||||
return (
|
||||
@@ -83,20 +84,24 @@ export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: s
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Bottom tab bar */}
|
||||
<nav className="glass safe-pb-tabbar fixed bottom-0 left-1/2 z-30 flex w-full max-w-2xl -translate-x-1/2 items-stretch justify-around rounded-t-3xl px-2 pt-2">
|
||||
{tabs.map((x) => (
|
||||
<button
|
||||
key={x.id}
|
||||
onClick={() => setTab(x.id)}
|
||||
className={`flex flex-1 flex-col items-center gap-0.5 rounded-2xl py-2 text-[11px] font-medium transition ${
|
||||
tab === x.id ? 'bg-white/60 text-[var(--accent)]' : 'text-[var(--text)]/60'
|
||||
}`}
|
||||
>
|
||||
<span className="text-lg">{x.icon}</span>
|
||||
{x.label}
|
||||
</button>
|
||||
))}
|
||||
{/* Bottom dock navigation */}
|
||||
<nav className="safe-pb-tabbar fixed bottom-0 left-1/2 z-30 w-full max-w-md -translate-x-1/2 px-3 pb-3">
|
||||
<div className="dock-bar">
|
||||
{tabs.map(({ id, label, Icon }) => (
|
||||
<button
|
||||
key={id}
|
||||
onClick={() => setTab(id)}
|
||||
className={`dock-btn ${tab === id ? 'is-active' : ''}`}
|
||||
aria-label={label}
|
||||
>
|
||||
<span className="dock-tip">{label}</span>
|
||||
<span className="dock-chip">
|
||||
<Icon className="h-[26px] w-[26px]" />
|
||||
</span>
|
||||
<span className="dock-dot" />
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{publishOpen && (
|
||||
|
||||
@@ -40,11 +40,23 @@ export default function EditorLogin({
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen items-center justify-center p-4">
|
||||
<form onSubmit={submit} className="glass flex w-full max-w-sm flex-col gap-3 rounded-3xl p-6">
|
||||
<h1 className="display text-2xl font-semibold">{name}</h1>
|
||||
<p className="text-sm text-[var(--text)]/60">{t('login')}</p>
|
||||
{!secret && <p className="text-sm text-amber-700">{t('invalidLink')}</p>}
|
||||
<main className="relative flex min-h-screen items-center justify-center overflow-hidden p-4">
|
||||
<video
|
||||
autoPlay
|
||||
loop
|
||||
muted
|
||||
playsInline
|
||||
src="/videos/panel-restaurante.mp4"
|
||||
className="absolute inset-0 h-full w-full object-cover"
|
||||
/>
|
||||
<div className="absolute inset-0 bg-black/45" />
|
||||
<form
|
||||
onSubmit={submit}
|
||||
className="glass relative z-10 flex w-full max-w-sm flex-col gap-3 rounded-3xl p-6"
|
||||
>
|
||||
<h1 className="display text-center text-2xl font-semibold">{name}</h1>
|
||||
<p className="text-center text-sm text-[var(--text)]/60">{t('login')}</p>
|
||||
{!secret && <p className="text-center text-sm text-amber-700">{t('invalidLink')}</p>}
|
||||
<input
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
@@ -59,10 +71,11 @@ export default function EditorLogin({
|
||||
placeholder={t('password')}
|
||||
className="glass-soft rounded-2xl px-4 py-3 outline-none"
|
||||
/>
|
||||
{error && <p className="text-sm text-red-600">{error}</p>}
|
||||
{error && <p className="text-center text-sm text-red-600">{error}</p>}
|
||||
<button
|
||||
disabled={loading || !secret}
|
||||
className="rounded-2xl bg-[var(--accent)] py-3 font-medium text-white disabled:opacity-50"
|
||||
className="rounded-2xl py-3 font-medium text-white disabled:opacity-50"
|
||||
style={{ backgroundColor: '#dc2626' }}
|
||||
>
|
||||
{t('login')}
|
||||
</button>
|
||||
|
||||
@@ -35,14 +35,13 @@ function itemTimer(it: OrderItem, fallbackStart: string, now: number, th: Thresh
|
||||
const secs = Math.max(0, Math.floor((end - start) / 1000));
|
||||
const mins = secs / 60;
|
||||
const label = `${Math.floor(secs / 60)}:${(secs % 60).toString().padStart(2, '0')}`;
|
||||
const color = it.delivered
|
||||
? '#6b7280'
|
||||
: mins < th.green
|
||||
? '#15803d'
|
||||
: mins < th.yellow
|
||||
? '#b45309'
|
||||
: '#dc2626';
|
||||
return { label, color };
|
||||
// Threshold tier reused for both the timer pill color and the pulsing status pill class.
|
||||
const tier = it.delivered ? 'done' : mins < th.green ? 'green' : mins < th.yellow ? 'yellow' : 'red';
|
||||
const color =
|
||||
tier === 'done' ? '#6b7280' : tier === 'green' ? '#28bd1c' : tier === 'yellow' ? '#fce167' : '#ef4444';
|
||||
const textColor = tier === 'yellow' ? 'rgba(0,0,0,.72)' : '#fff';
|
||||
const pulseClass = tier === 'green' ? 'pendiente-green' : tier === 'yellow' ? 'pendiente-yellow' : 'pendiente-red';
|
||||
return { label, color, textColor, pulseClass };
|
||||
}
|
||||
|
||||
// Group a subaccount's items into batches (by batchId), sorted by start time.
|
||||
@@ -233,21 +232,21 @@ export default function OrdersTab({
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-2 text-sm">
|
||||
<span className="flex items-center gap-1">
|
||||
<span className="h-3 w-3 rounded-full bg-green-600" />
|
||||
<span className="h-3 w-3 rounded-full" style={{ backgroundColor: 'rgb(40,189,28)' }} />
|
||||
<input
|
||||
type="number" min={1} max={120} value={green}
|
||||
onChange={(e) => setGreen(Math.max(1, Math.min(120, Number(e.target.value) || 1)))}
|
||||
onBlur={() => patchSettings({ timerGreenMax: green })}
|
||||
className="glass-soft w-12 rounded-xl px-1 py-1 text-center outline-none"
|
||||
className="editable-num w-12 rounded-xl border border-black/10 bg-white/60 px-1 py-1 text-center outline-none focus:border-black/30 focus:bg-white"
|
||||
/>
|
||||
</span>
|
||||
<span className="flex items-center gap-1">
|
||||
<span className="h-3 w-3 rounded-full bg-amber-500" />
|
||||
<span className="h-3 w-3 rounded-full" style={{ backgroundColor: 'rgb(252,225,103)' }} />
|
||||
<input
|
||||
type="number" min={1} max={240} value={yellow}
|
||||
onChange={(e) => setYellow(Math.max(1, Math.min(240, Number(e.target.value) || 1)))}
|
||||
onBlur={() => patchSettings({ timerYellowMax: yellow })}
|
||||
className="glass-soft w-12 rounded-xl px-1 py-1 text-center outline-none"
|
||||
className="editable-num w-12 rounded-xl border border-black/10 bg-white/60 px-1 py-1 text-center outline-none focus:border-black/30 focus:bg-white"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
@@ -263,7 +262,7 @@ export default function OrdersTab({
|
||||
type="number" min={1} max={720} value={retention}
|
||||
onChange={(e) => setRetention(Math.max(1, Math.min(720, Number(e.target.value) || 1)))}
|
||||
onBlur={() => patchSettings({ orderRetentionHours: retention })}
|
||||
className="glass-soft w-16 rounded-xl px-2 py-1.5 text-center text-sm outline-none"
|
||||
className="editable-num w-16 rounded-xl border border-black/10 bg-white/60 px-2 py-1.5 text-center text-sm outline-none focus:border-black/30 focus:bg-white"
|
||||
/>
|
||||
<span className="text-xs text-[var(--text)]/55">{t('hours')}</span>
|
||||
</div>
|
||||
@@ -276,8 +275,8 @@ export default function OrdersTab({
|
||||
{ordersEnabled && waiterCalls.length > 0 && (
|
||||
<div className="flex flex-col gap-2">
|
||||
{waiterCalls.map((c, i) => (
|
||||
<div key={i} className="animate-spawn flex items-center gap-2 rounded-2xl bg-amber-100/80 px-4 py-2 text-sm text-amber-800">
|
||||
🔔 <strong>{t('table')} {c.tableNumber}</strong>
|
||||
<div key={i} className="animate-spawn flex items-center justify-between gap-2 rounded-2xl bg-amber-100/80 px-4 py-2 text-sm text-amber-800">
|
||||
<span className="font-bold">{t('waiterAlert', { table: c.tableNumber })}</span>
|
||||
<button onClick={() => setWaiterCalls((prev) => prev.filter((_, idx) => idx !== i))} className="ml-auto">✕</button>
|
||||
</div>
|
||||
))}
|
||||
@@ -338,10 +337,9 @@ function TableCard({
|
||||
const allPaid = subaccounts.every((o) => o.paid);
|
||||
|
||||
return (
|
||||
<div className="animate-spawn glass relative flex flex-col gap-2 rounded-3xl p-4">
|
||||
<div className="animate-spawn glass relative flex flex-col gap-2 rounded-3xl border-2 border-[#9ca3af] p-4">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<span className="display text-lg font-semibold">{t('table')} {table}</span>
|
||||
<span className="text-sm font-semibold text-[var(--accent)]">${tableTotal.toFixed(2)}</span>
|
||||
</div>
|
||||
|
||||
{subaccounts.map((sub) => (
|
||||
@@ -366,7 +364,8 @@ function TableCard({
|
||||
</div>
|
||||
<button
|
||||
onClick={() => onCompleteTable(subaccounts.map((s) => s.id))}
|
||||
className={`rounded-2xl py-2 text-sm font-medium text-white ${allPaid ? 'bg-green-600' : 'bg-[var(--accent)]'}`}
|
||||
className="liquid-btn rounded-2xl py-2 text-sm font-medium text-white"
|
||||
style={{ backgroundColor: allPaid ? '#16a34a' : '#dc2626' }}
|
||||
>
|
||||
{t('completeTable')}
|
||||
</button>
|
||||
@@ -450,18 +449,18 @@ function SubaccountCard({
|
||||
{it.note && <span className="block text-xs text-[var(--accent)]">↳ {it.note}</span>}
|
||||
</span>
|
||||
<span
|
||||
className="shrink-0 rounded-full px-2 py-0.5 font-mono text-xs font-semibold text-white"
|
||||
style={{ background: tm.color }}
|
||||
className="shrink-0 rounded-full px-2 py-0.5 font-mono text-xs font-semibold"
|
||||
style={{ background: tm.color, color: tm.textColor }}
|
||||
>
|
||||
{tm.label}
|
||||
</span>
|
||||
<button
|
||||
onClick={() => it.id && onDeliver(sub.id, it.id, !it.delivered)}
|
||||
className={`shrink-0 rounded-full px-2 py-1 text-[10px] font-medium ${
|
||||
it.delivered ? 'bg-gray-200 text-gray-600' : 'bg-green-600 text-white'
|
||||
it.delivered ? 'bg-gray-200 text-gray-600' : tm.pulseClass
|
||||
}`}
|
||||
>
|
||||
{it.delivered ? t('markUndelivered') : t('markDelivered')}
|
||||
{it.delivered ? t('markDelivered') : t('pending')}
|
||||
</button>
|
||||
</li>
|
||||
);
|
||||
@@ -561,7 +560,8 @@ function ItemsEditPanel({
|
||||
<button
|
||||
onClick={async () => { if (!items.length || saving) return; setSaving(true); try { await onSave(items); } finally { setSaving(false); } }}
|
||||
disabled={saving || items.length === 0}
|
||||
className="flex-1 rounded-2xl bg-[var(--accent)] py-2 text-sm font-medium text-white disabled:opacity-50"
|
||||
className="liquid-btn flex-1 rounded-2xl py-2 text-sm font-medium text-white disabled:opacity-50"
|
||||
style={{ backgroundColor: '#dc2626' }}
|
||||
>
|
||||
{tc('save')}
|
||||
</button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import type { EditorProduct, EditorSection } from './types';
|
||||
import { MACRO_KEYS } from '@/lib/macros';
|
||||
import { MACRO_KEYS, MACRO_COLORS } from '@/lib/macros';
|
||||
import { api } from './api';
|
||||
|
||||
const ALLERGENS = ['gluten', 'lácteos', 'frutos secos', 'mariscos', 'huevo', 'soya', 'pescado'];
|
||||
@@ -26,6 +26,7 @@ export default function ProductEditor({
|
||||
}) {
|
||||
const t = useTranslations('editor');
|
||||
const tm = useTranslations('macros');
|
||||
const tc = useTranslations('common');
|
||||
const [draft, setDraft] = useState<EditorProduct>(product);
|
||||
const [saving, setSaving] = useState(false);
|
||||
const [translating, setTranslating] = useState<string | null>(null);
|
||||
@@ -125,10 +126,14 @@ export default function ProductEditor({
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-end justify-center bg-black/40 p-2 backdrop-blur-sm sm:items-center">
|
||||
<div className="glass flex max-h-[92vh] w-full max-w-lg flex-col gap-4 overflow-y-auto rounded-3xl p-4">
|
||||
<div className="glass safe-modal flex max-h-[92vh] w-full max-w-lg flex-col gap-6 overflow-y-auto rounded-3xl p-5">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="display text-lg font-semibold">{t('edit')}</h3>
|
||||
<button onClick={onClose} className="glass-pill rounded-full px-3 py-1">
|
||||
<h3 className="display text-xl font-semibold">{t('edit')}</h3>
|
||||
<button
|
||||
onClick={onClose}
|
||||
aria-label={tc('close')}
|
||||
className="liquid-btn flex h-9 w-9 items-center justify-center rounded-full text-base"
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
@@ -141,19 +146,17 @@ export default function ProductEditor({
|
||||
value={draft.name.es ?? ''}
|
||||
onChange={(v) => set('name', { ...draft.name, es: v })}
|
||||
/>
|
||||
<div className="flex items-center gap-2">
|
||||
<LocaleInput
|
||||
prefix="EN"
|
||||
value={draft.name.en ?? ''}
|
||||
onChange={(v) =>
|
||||
setDraft((d) => ({
|
||||
...d,
|
||||
name: { ...d.name, en: v },
|
||||
translationStatus: { ...d.translationStatus, en: 'reviewed' },
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<LocaleInput
|
||||
prefix="EN"
|
||||
value={draft.name.en ?? ''}
|
||||
onChange={(v) =>
|
||||
setDraft((d) => ({
|
||||
...d,
|
||||
name: { ...d.name, en: v },
|
||||
translationStatus: { ...d.translationStatus, en: 'reviewed' },
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<TranslateRow
|
||||
loading={translating === 'name'}
|
||||
status={enStatus}
|
||||
@@ -202,14 +205,14 @@ export default function ProductEditor({
|
||||
min={0}
|
||||
value={draft.price}
|
||||
onChange={(e) => set('price', Number(e.target.value))}
|
||||
className="glass-soft w-full rounded-2xl px-3 py-2 outline-none"
|
||||
className="glass-soft w-full rounded-2xl px-3 py-2 text-sm outline-none"
|
||||
/>
|
||||
</Field>
|
||||
<Field label={t('section')} className="flex-1">
|
||||
<select
|
||||
value={draft.sectionId}
|
||||
onChange={(e) => set('sectionId', e.target.value)}
|
||||
className="glass-soft w-full rounded-2xl px-3 py-2 outline-none"
|
||||
className="glass-soft w-full rounded-2xl px-3 py-2 text-sm outline-none"
|
||||
>
|
||||
{sections.map((s) => (
|
||||
<option key={s.id} value={s.id}>
|
||||
@@ -248,7 +251,10 @@ export default function ProductEditor({
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
<label className="flex h-20 w-20 cursor-pointer items-center justify-center rounded-xl border border-dashed border-[var(--accent)]/40 text-2xl text-[var(--accent)]">
|
||||
<label
|
||||
title={t('uploadMedia')}
|
||||
className="flex h-20 w-20 cursor-pointer items-center justify-center rounded-xl border-2 border-dashed border-[var(--text)]/30 text-2xl text-[var(--text)]/50 transition hover:border-[var(--text)]/50 hover:text-[var(--text)]/70"
|
||||
>
|
||||
{uploading ? '…' : '+'}
|
||||
<input
|
||||
type="file"
|
||||
@@ -262,12 +268,14 @@ export default function ProductEditor({
|
||||
</Field>
|
||||
|
||||
{/* Macros */}
|
||||
<Field label="Macros">
|
||||
<Field label={tm('title')}>
|
||||
{draft.aiEstimated.macros && <EstimatedBadge />}
|
||||
<div className="grid grid-cols-3 gap-2">
|
||||
<div className="grid grid-cols-3 gap-x-3 gap-y-2.5">
|
||||
{MACRO_KEYS.map((key) => (
|
||||
<label key={key} className="flex flex-col gap-1 text-xs">
|
||||
{tm(key)}
|
||||
<span className="font-medium" style={{ color: MACRO_COLORS[key] }}>
|
||||
{tm(key)}
|
||||
</span>
|
||||
<input
|
||||
type="number"
|
||||
min={0}
|
||||
@@ -283,7 +291,7 @@ export default function ProductEditor({
|
||||
aiEstimated: { ...d.aiEstimated, macros: false },
|
||||
}))
|
||||
}
|
||||
className="glass-soft rounded-xl px-2 py-1.5 outline-none"
|
||||
className="glass-soft rounded-xl px-2 py-1.5 text-sm outline-none"
|
||||
/>
|
||||
</label>
|
||||
))}
|
||||
@@ -315,17 +323,19 @@ export default function ProductEditor({
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<div className="flex gap-2 pt-1">
|
||||
{/* Actions */}
|
||||
<div className="mt-1 flex gap-3 border-t border-white/30 pt-5">
|
||||
<button
|
||||
onClick={() => onDelete(draft)}
|
||||
className="rounded-2xl bg-red-100 px-4 py-3 text-sm font-medium text-red-700"
|
||||
className="liquid-btn rounded-2xl px-5 py-3 text-sm font-medium text-red-700"
|
||||
>
|
||||
{t('delete')}
|
||||
</button>
|
||||
<button
|
||||
onClick={save}
|
||||
disabled={saving}
|
||||
className="flex-1 rounded-2xl bg-[var(--accent)] py-3 font-medium text-white disabled:opacity-50"
|
||||
className="flex-1 rounded-2xl py-3 text-sm font-semibold text-white shadow-lg transition active:scale-[0.99] disabled:opacity-50"
|
||||
style={{ backgroundColor: '#dc2626' }}
|
||||
>
|
||||
{t('save')}
|
||||
</button>
|
||||
@@ -354,8 +364,8 @@ function Field({
|
||||
className?: string;
|
||||
}) {
|
||||
return (
|
||||
<div className={`flex flex-col gap-1.5 ${className}`}>
|
||||
<span className="text-xs font-medium text-[var(--text)]/60">{label}</span>
|
||||
<div className={`flex flex-col gap-2 ${className}`}>
|
||||
<span className="text-sm font-medium text-[var(--text)]/70">{label}</span>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -372,7 +382,7 @@ function LocaleInput({
|
||||
}) {
|
||||
return (
|
||||
<div className="glass-soft flex items-center gap-2 rounded-2xl px-3">
|
||||
<span className="text-[10px] font-bold text-[var(--text)]/40">{prefix}</span>
|
||||
<span className="text-xs font-bold text-[var(--text)]/50">{prefix}</span>
|
||||
<input
|
||||
value={value}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
@@ -397,7 +407,7 @@ function TranslateRow({
|
||||
<button
|
||||
onClick={onClick}
|
||||
disabled={loading}
|
||||
className="glass-pill rounded-full px-3 py-1 text-xs font-medium disabled:opacity-50"
|
||||
className="liquid-btn flex items-center gap-2 whitespace-nowrap rounded-full px-3 py-2 text-xs font-semibold disabled:opacity-50"
|
||||
>
|
||||
{loading ? '…' : `✨ ${t('translateAi')}`}
|
||||
</button>
|
||||
@@ -429,10 +439,10 @@ function Chips({
|
||||
<button
|
||||
key={o}
|
||||
onClick={() => onToggle(o)}
|
||||
className={`rounded-full px-3 py-1 text-xs transition ${
|
||||
className={`rounded-lg px-3 py-1 text-xs transition ${
|
||||
selected.includes(o)
|
||||
? 'bg-[var(--accent)] text-white'
|
||||
: 'glass-soft text-[var(--text)]/70'
|
||||
? 'bg-neutral-900 text-white'
|
||||
: 'glass-soft text-[var(--text)]/70 hover:text-[var(--text)]'
|
||||
}`}
|
||||
>
|
||||
{o}
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function SectionTitleEditor({
|
||||
value={value}
|
||||
onChange={(e) => setValue(e.target.value)}
|
||||
onBlur={commit}
|
||||
className="display flex-1 bg-transparent text-lg font-semibold outline-none"
|
||||
className="display flex-1 bg-transparent text-base font-semibold outline-none"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -61,10 +61,10 @@ export default function VersionHistory({
|
||||
{versions.map((v) => (
|
||||
<div key={v.id} className="glass-soft flex items-center gap-2 rounded-2xl px-3 py-2">
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="truncate text-sm font-medium">
|
||||
{v.versionName}
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<span className="truncate text-sm font-medium">{v.versionName}</span>
|
||||
{v.id === publishedId && (
|
||||
<span className="ml-2 rounded-full bg-green-100 px-2 py-0.5 text-[10px] text-green-700">
|
||||
<span className="shrink-0 rounded-full bg-green-100 px-2 py-0.5 text-[10px] text-green-700">
|
||||
{t('publishedVersion')}
|
||||
</span>
|
||||
)}
|
||||
@@ -79,13 +79,15 @@ export default function VersionHistory({
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => restore(v)}
|
||||
disabled={restoring === v.id}
|
||||
className="glass-pill rounded-full px-3 py-1 text-xs font-medium disabled:opacity-50"
|
||||
>
|
||||
{tc('restore')}
|
||||
</button>
|
||||
{v.id !== publishedId && (
|
||||
<button
|
||||
onClick={() => restore(v)}
|
||||
disabled={restoring === v.id}
|
||||
className="glass-pill shrink-0 rounded-full px-3 py-1 text-xs font-medium disabled:opacity-50"
|
||||
>
|
||||
{tc('restore')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -64,7 +64,7 @@ export default function AiConsultant({
|
||||
function Card(r: Recommendation, key: number) {
|
||||
const product = resolveDish(r.dish);
|
||||
return (
|
||||
<div key={key} className="glass-soft flex items-start gap-2 rounded-2xl p-3">
|
||||
<div key={key} className="glass-soft flex items-start gap-3 rounded-2xl p-4">
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="font-semibold text-[var(--accent)]">{r.dish}</div>
|
||||
<p className="text-sm text-[var(--text)]/80">{r.reason}</p>
|
||||
@@ -72,7 +72,8 @@ export default function AiConsultant({
|
||||
{ordersEnabled && product && (
|
||||
<button
|
||||
onClick={() => onAdd(product)}
|
||||
className="shrink-0 rounded-full bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-white"
|
||||
style={{ backgroundColor: '#dc2626' }}
|
||||
className="shrink-0 rounded-full px-3 py-1.5 text-xs font-medium text-white"
|
||||
>
|
||||
{tm('addToOrder')}
|
||||
</button>
|
||||
@@ -83,7 +84,7 @@ export default function AiConsultant({
|
||||
|
||||
return (
|
||||
<div className="safe-modal fixed inset-0 z-50 flex items-end justify-center bg-black/40 px-3 backdrop-blur-sm sm:items-center">
|
||||
<div className="glass flex max-h-[85vh] w-full max-w-md flex-col gap-3 rounded-3xl p-4">
|
||||
<div className="glass flex max-h-[85vh] w-full max-w-md flex-col gap-5 rounded-3xl p-5">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="display text-lg font-semibold">{t('title')}</h3>
|
||||
<button onClick={onClose} className="glass-pill rounded-full px-3 py-1">
|
||||
@@ -91,13 +92,13 @@ export default function AiConsultant({
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="min-h-[6rem] flex-1 overflow-y-auto">
|
||||
<div className="min-h-[6rem] flex-1 overflow-y-auto no-scrollbar">
|
||||
{!answer && !loading && <p className="text-sm text-[var(--text)]/60">{t('intro')}</p>}
|
||||
{loading && <p className="animate-pulse text-sm text-[var(--text)]/60">{t('thinking')}</p>}
|
||||
{error && <p className="text-sm text-red-600">⚠️</p>}
|
||||
{answer && (
|
||||
<div className="flex flex-col gap-2">
|
||||
{answer.intro && <p className="text-sm text-[var(--text)]/80">{answer.intro}</p>}
|
||||
<div className="flex flex-col gap-3">
|
||||
{answer.intro && <p className="mb-1 text-sm text-[var(--text)]/80">{answer.intro}</p>}
|
||||
{(() => {
|
||||
const direct = answer.recommendations.filter((r) => r.type !== 'complement');
|
||||
const complement = answer.recommendations.filter((r) => r.type === 'complement');
|
||||
@@ -106,7 +107,7 @@ export default function AiConsultant({
|
||||
{direct.map((r, i) => Card(r, i))}
|
||||
{complement.length > 0 && (
|
||||
<>
|
||||
<p className="mt-1 text-xs font-semibold uppercase tracking-wide text-[var(--text)]/50">
|
||||
<p className="mt-2 text-xs font-semibold uppercase tracking-wide text-[var(--text)]/50">
|
||||
{t('pairWith')}
|
||||
</p>
|
||||
{complement.map((r, i) => Card(r, direct.length + i))}
|
||||
@@ -120,7 +121,7 @@ export default function AiConsultant({
|
||||
|
||||
{/* Precomputed pairings carousel (reuses the cart component) */}
|
||||
{ordersEnabled && suggestions.length > 0 && (
|
||||
<div className="mt-4">
|
||||
<div className="mt-6">
|
||||
<SuggestionCarousel products={suggestions} onAdd={onAdd} />
|
||||
</div>
|
||||
)}
|
||||
@@ -137,7 +138,8 @@ export default function AiConsultant({
|
||||
<button
|
||||
onClick={ask}
|
||||
disabled={loading}
|
||||
className="rounded-full bg-[var(--accent)] px-4 py-2 text-sm font-medium text-white disabled:opacity-50"
|
||||
style={{ backgroundColor: '#dc2626' }}
|
||||
className="rounded-full px-4 py-2 text-sm font-medium text-white disabled:opacity-50"
|
||||
>
|
||||
→
|
||||
</button>
|
||||
|
||||
@@ -48,7 +48,7 @@ export default function BrandHeader({
|
||||
const hasLogo = !!logo;
|
||||
|
||||
const socialRow = links.length > 0 && (
|
||||
<div className="flex flex-wrap items-center justify-center gap-2">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
{links.map((l, i) => {
|
||||
const Icon = iconFor(l.platform);
|
||||
return (
|
||||
@@ -84,7 +84,7 @@ export default function BrandHeader({
|
||||
<header className="mb-4">
|
||||
{/* Banner — full-bleed, extends edge-to-edge behind the island. A short
|
||||
palette gradient stands in when there's a logo but no banner image. */}
|
||||
<div className="relative -mx-4 h-36 overflow-hidden">
|
||||
<div className="relative -mx-4 h-52 overflow-hidden">
|
||||
{hasBanner ? (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img src={banner!} alt="" className="h-full w-full object-cover" />
|
||||
@@ -100,9 +100,9 @@ export default function BrandHeader({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Logo + name + socials, the avatar centered over the banner's lower edge. */}
|
||||
<div className="relative z-10 -mt-12 flex flex-col items-center gap-2 px-2 text-center">
|
||||
<div className="h-24 w-24 overflow-hidden rounded-full border-4 border-white/70 bg-white/50 shadow-lg">
|
||||
{/* Logo (left) + name + socials, below the banner. */}
|
||||
<div className="relative z-10 flex items-start gap-3 px-2 pt-5">
|
||||
<div className="h-24 w-24 shrink-0 overflow-hidden rounded-full border-4 border-white/70 bg-white/50 shadow-lg">
|
||||
{hasLogo ? (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img src={logo!} alt={name} className="h-full w-full object-cover" />
|
||||
@@ -112,8 +112,10 @@ export default function BrandHeader({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<h1 className="display text-2xl font-semibold leading-tight">{name}</h1>
|
||||
{socialRow}
|
||||
<div className="flex min-w-0 flex-1 flex-col gap-4 pt-1">
|
||||
<h1 className="display text-2xl font-semibold leading-tight">{name}</h1>
|
||||
{socialRow}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
|
||||
@@ -32,69 +32,68 @@ export default function DishCard({
|
||||
const sortedMedia = [...product.media].sort((a, b) => a.order - b.order);
|
||||
const cover = sortedMedia[0];
|
||||
const hasVideo = sortedMedia.some((m) => m.type === 'video');
|
||||
const canAdd = ordersEnabled && !!onAdd;
|
||||
|
||||
return (
|
||||
<div
|
||||
className="flip-scene animate-fade-up"
|
||||
style={{ animationDelay: `${Math.min(index * 70, 500)}ms` }}
|
||||
>
|
||||
<div className={`flip-card min-h-[20rem] ${flipped ? 'is-flipped' : ''}`}>
|
||||
<div className={`flip-card min-h-[24rem] ${flipped ? 'is-flipped' : ''}`}>
|
||||
{/* FRONT */}
|
||||
<div className="flip-face flip-front glass overflow-hidden rounded-3xl">
|
||||
<button
|
||||
className="relative block h-40 w-full"
|
||||
onClick={() => onOpenGallery(product)}
|
||||
aria-label={name}
|
||||
>
|
||||
<MediaThumb media={cover} alt={name} className="h-40 w-full" />
|
||||
{hasVideo && (
|
||||
<span className="absolute right-3 top-3 h-3 w-3 animate-pulse-dot rounded-full bg-red-500 shadow" />
|
||||
)}
|
||||
</button>
|
||||
<div className="flex flex-col gap-2 p-4">
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<h3 className="display text-lg font-semibold leading-tight">{name}</h3>
|
||||
<span className="shrink-0 text-base font-bold text-[var(--accent)]">
|
||||
<div
|
||||
className="flip-face flip-front overflow-hidden rounded-3xl bg-white"
|
||||
style={{
|
||||
boxShadow:
|
||||
'0 22px 40px -12px rgba(40,30,20,.35), 0 8px 16px -8px rgba(40,30,20,.25)',
|
||||
}}
|
||||
>
|
||||
<div className="p-3 pb-0">
|
||||
<button
|
||||
className="relative block w-full"
|
||||
onClick={() => onOpenGallery(product)}
|
||||
aria-label={name}
|
||||
>
|
||||
<MediaThumb media={cover} alt={name} className="h-44 w-full rounded-2xl" />
|
||||
{hasVideo && (
|
||||
<span className="absolute right-3 top-3 h-3 w-3 animate-pulse-dot rounded-full bg-red-500 shadow" />
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
<div className="flex flex-col items-center gap-3 px-4 pb-4 pt-4 text-center">
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<h3 className="display text-[20px] font-bold leading-tight">{name}</h3>
|
||||
<span
|
||||
className="w-px shrink-0 self-stretch"
|
||||
style={{ background: 'rgba(42,37,32,.18)' }}
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="shrink-0 self-center text-[20px] font-bold text-black">
|
||||
${product.price.toFixed(2)}
|
||||
</span>
|
||||
</div>
|
||||
{description && (
|
||||
<p className="whitespace-pre-line text-sm text-[var(--text)]/70">{description}</p>
|
||||
)}
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{product.dietTags.map((tag) => (
|
||||
<span key={tag} className="glass-soft rounded-full px-2 py-0.5 text-[11px]">
|
||||
{tag}
|
||||
</span>
|
||||
))}
|
||||
{product.allergens.map((a) => (
|
||||
<span
|
||||
key={a}
|
||||
className="rounded-full bg-amber-100/60 px-2 py-0.5 text-[11px] text-amber-800"
|
||||
>
|
||||
{a}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
{(showMacros || (ordersEnabled && onAdd)) && (
|
||||
<div className="mt-1 flex items-center gap-2">
|
||||
{(showMacros || canAdd) && (
|
||||
<div className="mt-1 flex w-full items-stretch gap-3">
|
||||
{showMacros && (
|
||||
<button
|
||||
onClick={() => setFlipped(true)}
|
||||
className="glass-pill flex-1 rounded-full py-2 text-sm font-medium"
|
||||
className="flex-1 rounded-2xl px-3 py-2 text-sm font-semibold"
|
||||
style={{ background: '#f1d6ad', color: '#3a2f1f' }}
|
||||
>
|
||||
{t('tapToFlip')}
|
||||
{t('nutrition')}
|
||||
</button>
|
||||
)}
|
||||
{ordersEnabled && onAdd && (
|
||||
{canAdd && (
|
||||
<button
|
||||
onClick={() => onAdd(product)}
|
||||
onClick={() => onAdd!(product)}
|
||||
aria-label={t('addToOrder')}
|
||||
className={`rounded-full bg-[var(--accent)] px-4 py-2 text-sm font-medium text-white ${
|
||||
showMacros ? '' : 'flex-1'
|
||||
}`}
|
||||
className="flex-1 rounded-2xl px-3 py-2 text-sm font-semibold leading-tight text-white"
|
||||
style={{ background: '#dc2626' }}
|
||||
>
|
||||
{showMacros ? '+' : t('addToOrder')}
|
||||
{t('addToOrderLong')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
@@ -103,17 +102,22 @@ export default function DishCard({
|
||||
</div>
|
||||
|
||||
{/* BACK */}
|
||||
<div className="flip-face flip-back glass flex flex-col gap-3 rounded-3xl p-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div
|
||||
className="flip-face flip-back flex flex-col gap-3 rounded-3xl p-4"
|
||||
style={{ background: '#efece6' }}
|
||||
>
|
||||
<div className="flex items-center justify-center">
|
||||
<h3 className="display text-base font-semibold">{name}</h3>
|
||||
<button
|
||||
onClick={() => setFlipped(false)}
|
||||
className="glass-pill rounded-full px-3 py-1 text-sm"
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
<MacrosBack macros={product.macros} />
|
||||
<div className="flex flex-1 items-center justify-center">
|
||||
<button
|
||||
onClick={() => setFlipped(false)}
|
||||
className="glass-pill rounded-full px-5 py-2 text-sm uppercase tracking-wide"
|
||||
>
|
||||
{t('flipBack')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,19 +11,26 @@ export default function MacrosBack({ macros }: { macros: Macros }) {
|
||||
{MACRO_KEYS.map((key) => {
|
||||
const value = macros[key];
|
||||
return (
|
||||
<div key={key} className="glass-soft flex items-center gap-2 rounded-xl px-3 py-2">
|
||||
<span
|
||||
className="h-3 w-3 shrink-0 rounded-full"
|
||||
style={{ background: MACRO_COLORS[key] }}
|
||||
aria-hidden
|
||||
/>
|
||||
<div className="min-w-0">
|
||||
<div className="text-[11px] leading-tight text-[var(--text)]/60">{t(key)}</div>
|
||||
<div className="text-sm font-semibold" style={{ color: MACRO_COLORS[key] }}>
|
||||
{value != null ? `${value}${MACRO_UNIT[key] === 'g' ? ' g' : ''}` : '—'}
|
||||
{key === 'kcal' && value != null ? ' kcal' : ''}
|
||||
</div>
|
||||
<div
|
||||
key={key}
|
||||
className="macro-cell flex flex-col items-start justify-center gap-1 rounded-xl px-4 py-3.5"
|
||||
style={{ ['--c' as string]: MACRO_COLORS[key] } as React.CSSProperties}
|
||||
>
|
||||
<div
|
||||
className="text-[13px] font-semibold leading-tight"
|
||||
style={{ color: MACRO_COLORS[key] }}
|
||||
>
|
||||
{t(key)}
|
||||
</div>
|
||||
{value != null ? (
|
||||
<div className="macro-num whitespace-nowrap text-xl font-bold">
|
||||
{`${value} ${MACRO_UNIT[key]}`}
|
||||
</div>
|
||||
) : (
|
||||
<div className="whitespace-nowrap text-xl font-bold" style={{ color: MACRO_COLORS[key] }}>
|
||||
—
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -13,6 +13,7 @@ import AiConsultant from './AiConsultant';
|
||||
import SuggestionCarousel from './SuggestionCarousel';
|
||||
import SplitPanel, { type SplitSession } from './SplitPanel';
|
||||
import { getRecommendations } from '@/lib/recommendations';
|
||||
import { LayoutGrid, List as ListIcon } from 'lucide-react';
|
||||
|
||||
type ViewMode = 'cards' | 'list';
|
||||
|
||||
@@ -47,7 +48,6 @@ export default function PublicMenu({ menu, slug }: { menu: MenuSnapshot; slug: s
|
||||
null,
|
||||
);
|
||||
const [aiOpen, setAiOpen] = useState(false);
|
||||
const [actionsOpen, setActionsOpen] = useState(false);
|
||||
const [cart, setCart] = useState<CartLine[]>([]);
|
||||
const [orderOpen, setOrderOpen] = useState(false);
|
||||
const [waiterOpen, setWaiterOpen] = useState(false);
|
||||
@@ -58,6 +58,27 @@ export default function PublicMenu({ menu, slug }: { menu: MenuSnapshot; slug: s
|
||||
// View preference is intentionally not persisted — always starts on cards.
|
||||
const [view, setView] = useState<ViewMode>('cards');
|
||||
const sectionRefs = useRef<Record<string, HTMLElement | null>>({});
|
||||
const navRef = useRef<HTMLElement | null>(null);
|
||||
const [stuck, setStuck] = useState(false);
|
||||
|
||||
// Scroll-spy: highlight the section in view and switch the category bar to its
|
||||
// compact "stuck" state (business name + underlined tabs) once it pins to the top.
|
||||
useEffect(() => {
|
||||
function onScroll() {
|
||||
const nav = navRef.current;
|
||||
if (nav) setStuck(nav.getBoundingClientRect().top <= 12);
|
||||
const line = 140;
|
||||
let current = sections[0]?.id ?? '';
|
||||
for (const s of sections) {
|
||||
const el = sectionRefs.current[s.id];
|
||||
if (el && el.getBoundingClientRect().top <= line) current = s.id;
|
||||
}
|
||||
if (current) setActiveSection(current);
|
||||
}
|
||||
window.addEventListener('scroll', onScroll, { passive: true });
|
||||
onScroll();
|
||||
return () => window.removeEventListener('scroll', onScroll);
|
||||
}, [sections]);
|
||||
|
||||
// Flat index of active products for pairing lookups (by id) and consultant
|
||||
// add-to-cart resolution (by normalized name in either locale).
|
||||
@@ -194,45 +215,64 @@ export default function PublicMenu({ menu, slug }: { menu: MenuSnapshot; slug: s
|
||||
socialLinks={menu.restaurant.socialLinks}
|
||||
/>
|
||||
|
||||
{/* Section tabs */}
|
||||
{sections.length > 0 && (
|
||||
<nav className="safe-top-sticky sticky z-20 -mx-1 mb-4 flex gap-2 overflow-x-auto px-1 py-1 no-scrollbar">
|
||||
{sections.map((s) => (
|
||||
<button
|
||||
key={s.id}
|
||||
onClick={() => scrollToSection(s.id)}
|
||||
className={`glass-pill shrink-0 rounded-full px-4 py-2 text-sm font-medium transition ${
|
||||
activeSection === s.id ? 'ring-2 ring-[var(--accent)]/40' : ''
|
||||
}`}
|
||||
>
|
||||
{pickText(s.name, locale)}
|
||||
</button>
|
||||
))}
|
||||
</nav>
|
||||
)}
|
||||
|
||||
{/* View toggle (cards vs traditional list). Not persisted. */}
|
||||
<div className="mb-4 flex items-center justify-end gap-3">
|
||||
<div className="glass-pill inline-flex shrink-0 rounded-full p-1 text-sm">
|
||||
{/* View toggle (Cards / List) + Ask Claude */}
|
||||
<div className="mb-6 mt-2 flex flex-nowrap items-stretch justify-start gap-2">
|
||||
<div className="inline-flex shrink-0 items-stretch gap-1 rounded-full bg-black/5 p-0.5">
|
||||
<button
|
||||
onClick={() => setView('cards')}
|
||||
className={`rounded-full px-3 py-1 font-medium transition ${
|
||||
view === 'cards' ? 'bg-white/70 text-[var(--text)] shadow' : 'text-[var(--text)]/60'
|
||||
className={`seg-btn flex items-center gap-1.5 rounded-full px-3 py-2 ${
|
||||
view === 'cards' ? 'is-active' : ''
|
||||
}`}
|
||||
>
|
||||
{t('viewCards')}
|
||||
<LayoutGrid className="h-5 w-5 shrink-0" />
|
||||
<span className="text-sm font-semibold">{t('viewCards')}</span>
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setView('list')}
|
||||
className={`rounded-full px-3 py-1 font-medium transition ${
|
||||
view === 'list' ? 'bg-white/70 text-[var(--text)] shadow' : 'text-[var(--text)]/60'
|
||||
className={`seg-btn flex items-center gap-1.5 rounded-full px-3 py-2 ${
|
||||
view === 'list' ? 'is-active' : ''
|
||||
}`}
|
||||
>
|
||||
{t('viewList')}
|
||||
<ListIcon className="h-5 w-5 shrink-0" />
|
||||
<span className="text-sm font-semibold">{t('viewList')}</span>
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => setAiOpen(true)}
|
||||
className="ai-smoke flex min-w-0 flex-1 items-center justify-center gap-2 rounded-full px-3 py-2 text-sm font-semibold shadow-lg"
|
||||
>
|
||||
{t('askClaude')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Section heading + sticky category bar */}
|
||||
{sections.length > 0 && (
|
||||
<>
|
||||
<h2 className="display mb-2 text-center text-xl font-semibold">{t('explore')}</h2>
|
||||
<nav
|
||||
ref={navRef}
|
||||
className={`cat-bar safe-top-sticky sticky z-30 -mx-4 mb-4 px-4 pt-8 pb-2 no-scrollbar ${
|
||||
stuck ? 'is-stuck' : ''
|
||||
}`}
|
||||
>
|
||||
<div className="stuck-name text-center">{menu.restaurant.name}</div>
|
||||
<div className="cat-row no-scrollbar justify-center">
|
||||
{sections.map((s) => (
|
||||
<button
|
||||
key={s.id}
|
||||
onClick={() => scrollToSection(s.id)}
|
||||
className={`cat-btn shrink-0 rounded-full px-4 py-2 text-sm font-medium ${
|
||||
activeSection === s.id ? 'is-active' : ''
|
||||
}`}
|
||||
>
|
||||
{pickText(s.name, locale)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</nav>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Sections */}
|
||||
{sections.map((s) => (
|
||||
<section
|
||||
@@ -277,89 +317,57 @@ export default function PublicMenu({ menu, slug }: { menu: MenuSnapshot; slug: s
|
||||
</section>
|
||||
))}
|
||||
|
||||
{/* Floating actions — ordered vertical stack in the bottom-right corner so
|
||||
they never overlap each other or cover dish names/prices. */}
|
||||
{/* Floating actions — vertical stack, bottom-right. */}
|
||||
<div className="safe-bottom-fab fixed right-4 z-40 flex flex-col items-end gap-2.5">
|
||||
{actionsOpen && (
|
||||
<div className="animate-spawn flex flex-col items-end gap-2">
|
||||
<button
|
||||
onClick={() => {
|
||||
setWaiterOpen(true);
|
||||
setActionsOpen(false);
|
||||
}}
|
||||
className="glass rounded-full px-4 py-2.5 text-sm font-medium shadow"
|
||||
>
|
||||
{t('callWaiter')}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => {
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
setActionsOpen(false);
|
||||
}}
|
||||
className="glass rounded-full px-4 py-2.5 text-sm font-medium shadow"
|
||||
>
|
||||
{t('viewFull')}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
<button
|
||||
onClick={() => setAiOpen(true)}
|
||||
className="glass rounded-full px-5 py-3 text-sm font-semibold shadow-lg"
|
||||
>
|
||||
✨ {t('askAi')}
|
||||
</button>
|
||||
{/* In a split session the cart IS the diner's subaccount → show one
|
||||
'Mi cuenta' button (split). Otherwise show the normal cart, plus a
|
||||
separate Split button when split is enabled. */}
|
||||
{/* In a split session the cart IS the diner's subaccount → 'My account'.
|
||||
Otherwise the red 'Order' button (when ordering is enabled). */}
|
||||
{splitSession ? (
|
||||
<button
|
||||
onClick={() => setSplitOpen(true)}
|
||||
className="relative flex items-center gap-2 rounded-full bg-[var(--accent)] px-5 py-3 text-sm font-semibold text-white shadow-lg"
|
||||
className="ai-smoke-red relative flex items-center gap-2 rounded-full px-6 py-3 text-sm font-semibold text-white shadow-lg"
|
||||
>
|
||||
🧾 {t('myAccount')}
|
||||
{t('myAccount')}
|
||||
{cartCount > 0 && (
|
||||
<span className="absolute -right-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-white px-1 text-xs font-bold text-[var(--accent)] shadow">
|
||||
<span className="absolute -right-1.5 -top-1.5 flex h-6 min-w-6 items-center justify-center rounded-full bg-white px-1.5 text-xs font-bold text-[#dc2626]">
|
||||
{cartCount}
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
) : (
|
||||
<>
|
||||
{ordersEnabled && (
|
||||
<button
|
||||
onClick={() => setOrderOpen(true)}
|
||||
className="relative flex items-center gap-2 rounded-full bg-[var(--accent)] px-5 py-3 text-sm font-semibold text-white shadow-lg"
|
||||
>
|
||||
🛒 {t('cart')}
|
||||
{cartCount > 0 && (
|
||||
<span className="absolute -right-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-white px-1 text-xs font-bold text-[var(--accent)] shadow">
|
||||
{cartCount}
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
{splitEnabled && (
|
||||
<button
|
||||
onClick={() => {
|
||||
setSplitPrefillTable(null);
|
||||
setSplitOpen(true);
|
||||
}}
|
||||
className="glass rounded-full px-5 py-3 text-sm font-semibold shadow-lg"
|
||||
>
|
||||
🧾 {t('split')}
|
||||
</button>
|
||||
)}
|
||||
</>
|
||||
ordersEnabled && (
|
||||
<button
|
||||
onClick={() => setOrderOpen(true)}
|
||||
aria-label={t('order')}
|
||||
className="ai-smoke-red relative flex items-center gap-2 rounded-full px-6 py-3 text-sm font-semibold text-white shadow-lg"
|
||||
>
|
||||
{t('order')}
|
||||
{cartCount > 0 && (
|
||||
<span className="absolute -right-1.5 -top-1.5 flex h-6 min-w-6 items-center justify-center rounded-full bg-white px-1.5 text-xs font-bold text-[#dc2626]">
|
||||
{cartCount}
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
)
|
||||
)}
|
||||
{/* 'More' (waiter / back to top) — distinct ⋯ icon, not a '+', to avoid
|
||||
confusion with the add-to-cart '+' inside each dish. */}
|
||||
<button
|
||||
onClick={() => setActionsOpen((o) => !o)}
|
||||
className="glass flex h-11 w-11 items-center justify-center rounded-full text-xl shadow-lg"
|
||||
aria-label={t('actions')}
|
||||
onClick={() => setWaiterOpen(true)}
|
||||
className="flex h-11 items-center justify-center rounded-full px-5 text-sm font-semibold text-white shadow-lg"
|
||||
style={{ background: '#1e3a5f' }}
|
||||
>
|
||||
{actionsOpen ? '✕' : '⋯'}
|
||||
{t('callWaiter')}
|
||||
</button>
|
||||
{splitEnabled && !splitSession && (
|
||||
<button
|
||||
onClick={() => {
|
||||
setSplitPrefillTable(null);
|
||||
setSplitOpen(true);
|
||||
}}
|
||||
className="flex items-center gap-2 rounded-full px-6 py-3 text-sm font-semibold text-white shadow-lg"
|
||||
style={{ background: '#111' }}
|
||||
>
|
||||
{t('splitAction')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Modals */}
|
||||
@@ -626,7 +634,7 @@ function OrderPanel({
|
||||
<button
|
||||
onClick={() => newName.trim() && onCreateSubaccount(newName.trim(), Number(table))}
|
||||
disabled={!newName.trim()}
|
||||
className="rounded-2xl bg-[var(--accent)] py-3 font-medium text-white disabled:opacity-50"
|
||||
className="rounded-2xl bg-[#dc2626] py-3 font-medium text-white disabled:opacity-50"
|
||||
>
|
||||
{t('createSplit')}
|
||||
</button>
|
||||
@@ -634,7 +642,7 @@ function OrderPanel({
|
||||
) : (
|
||||
<button
|
||||
onClick={() => setPickNew(true)}
|
||||
className="rounded-2xl bg-[var(--accent)] py-3 font-medium text-white"
|
||||
className="rounded-2xl bg-[#dc2626] py-3 font-medium text-white"
|
||||
>
|
||||
{t('imNew')}
|
||||
</button>
|
||||
@@ -644,7 +652,7 @@ function OrderPanel({
|
||||
<button
|
||||
onClick={send}
|
||||
disabled={!table || cart.length === 0 || sending}
|
||||
className="rounded-2xl bg-[var(--accent)] py-3 font-medium text-white disabled:opacity-50"
|
||||
className="rounded-2xl bg-[#dc2626] py-3 font-medium text-white disabled:opacity-50"
|
||||
>
|
||||
{t('confirmOrder')}
|
||||
</button>
|
||||
@@ -687,7 +695,7 @@ function WaiterPanel({
|
||||
<button
|
||||
onClick={send}
|
||||
disabled={!table || sending}
|
||||
className="rounded-2xl bg-[var(--accent)] py-3 font-medium text-white disabled:opacity-50"
|
||||
className="rounded-2xl bg-[#dc2626] py-3 font-medium text-white disabled:opacity-50"
|
||||
>
|
||||
{t('send')}
|
||||
</button>
|
||||
|
||||
@@ -167,7 +167,7 @@ export default function SplitPanel({
|
||||
<button
|
||||
onClick={join}
|
||||
disabled={!name.trim() || !table || busy}
|
||||
className="rounded-2xl bg-[var(--accent)] py-3 font-medium text-white disabled:opacity-50"
|
||||
className="rounded-2xl bg-[#dc2626] py-3 font-medium text-white disabled:opacity-50"
|
||||
>
|
||||
{mode === 'split' && table ? t('joinSplit', { table: Number(table) }) : t('createSplit')}
|
||||
</button>
|
||||
@@ -188,16 +188,29 @@ export default function SplitPanel({
|
||||
<span className="min-w-0 flex-1 text-sm font-medium">
|
||||
{pickText(l.product.name, locale)}
|
||||
</span>
|
||||
<span className="shrink-0 text-sm text-[var(--text)]/60">
|
||||
<span className="w-16 shrink-0 text-right text-sm text-[var(--text)]/60">
|
||||
${(l.product.price * l.qty).toFixed(2)}
|
||||
</span>
|
||||
<button onClick={() => setQty(l.product.id, -1)} className="px-2 text-lg" aria-label="−">
|
||||
−
|
||||
</button>
|
||||
<span className="w-5 text-center">{l.qty}</span>
|
||||
<button onClick={() => setQty(l.product.id, 1)} className="px-2 text-lg" aria-label="+">
|
||||
+
|
||||
</button>
|
||||
<div
|
||||
className="flex shrink-0 items-center gap-1 rounded-full bg-white px-1.5 py-1"
|
||||
style={{ boxShadow: '0 2px 8px rgba(40,30,20,.15)' }}
|
||||
>
|
||||
<button
|
||||
onClick={() => setQty(l.product.id, -1)}
|
||||
className="flex h-7 w-7 items-center justify-center rounded-full text-lg leading-none"
|
||||
aria-label="−"
|
||||
>
|
||||
−
|
||||
</button>
|
||||
<span className="w-6 text-center text-sm font-medium">{l.qty}</span>
|
||||
<button
|
||||
onClick={() => setQty(l.product.id, 1)}
|
||||
className="flex h-7 w-7 items-center justify-center rounded-full text-lg leading-none"
|
||||
aria-label="+"
|
||||
>
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
value={l.note ?? ''}
|
||||
@@ -209,12 +222,12 @@ export default function SplitPanel({
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between px-1 text-sm">
|
||||
<span className="font-medium">{t('yourSubtotal')}</span>
|
||||
<div className="flex items-center justify-between px-1 text-base">
|
||||
<span className="font-bold">{t('yourSubtotal')}</span>
|
||||
<span className="font-semibold">${yourSubtotal.toFixed(2)}</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between px-1 text-sm">
|
||||
<span className="text-[var(--text)]/70">{t('tableTotal')}</span>
|
||||
<div className="flex items-center justify-between px-1 text-base">
|
||||
<span className="font-bold text-[#dc2626]">{t('tableTotal')}</span>
|
||||
<span className="font-semibold text-[var(--accent)]">${tableTotal.toFixed(2)}</span>
|
||||
</div>
|
||||
|
||||
@@ -225,7 +238,7 @@ export default function SplitPanel({
|
||||
<button
|
||||
onClick={sync}
|
||||
disabled={busy}
|
||||
className="flex-1 rounded-2xl bg-[var(--accent)] py-3 font-medium text-white disabled:opacity-50"
|
||||
className="flex-1 rounded-2xl bg-[#dc2626] py-3 font-medium text-white disabled:opacity-50"
|
||||
>
|
||||
{t('updateSubaccount')}
|
||||
</button>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Universal macro color code — FIXED across all restaurants (product standard).
|
||||
// Diners learn it once and recognize it in any menu. Never make this configurable.
|
||||
export const MACRO_COLORS = {
|
||||
protein: '#C2410C', // terracotta
|
||||
protein: '#dc2626', // red
|
||||
carbs: '#B45309', // toasted amber
|
||||
sugar: '#BE185D', // magenta
|
||||
fat: '#CA8A04', // gold
|
||||
|
||||
Reference in new issue
Block a user