feat(waiter): English-first texts, part a: shell, sign-in, tables, settings, venues (platform-v2 step 4.5a)

- @xenia/i18n: new `waiter` namespace (en + el); the waiter's Greek texts become keys
  with English written fresh (Greek kept as the translation).
- App gates, side drawer / nav bars / notifications, user menu, login, table list and
  cards, settings, venues + pairing errors, install dialog, lock screen, update banners,
  QR scanner, favourites setup.
- Money and times through useFormat() (venue time, the language's number format):
  table cards, quick table view, user menu, notifications.
- waiter i18n.js: tw() for code outside components (pairing errors).
- The table-list's FavoritesSetupPage `.map(t => …)` renamed so it doesn't shadow t.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 03:50:33 +02:00
co-authored by Claude Opus 5.5
parent 8e0a786bbc
commit 37155c0457
20 changed files with 1229 additions and 375 deletions
+127 -121
View File
@@ -6,22 +6,23 @@ import useNotificationSettingsStore from '../store/notificationSettingsStore'
import useOrderingSettingsStore from '../store/orderingSettingsStore'
import usePaymentSettingsStore from '../store/paymentSettingsStore'
import useWaiterFavoritesStore from '../store/waiterFavoritesStore'
import { useTranslation } from '@xenia/i18n'
const CHIP_STYLE_OPTIONS = [
{ key: 'full', label: 'Πλήρες κείμενο', example: 'Εκκρεμούν' },
{ key: 'short', label: 'Σύντομο κείμενο', example: 'PND' },
{ key: 'icon_full', label: 'Εικονίδιο + πλήρες', example: '⏳ Εκκρεμούν' },
{ key: 'icon_short', label: 'Εικονίδιο + σύντομο', example: '⏳ PND' },
{ key: 'icon', label: 'Μόνο εικονίδιο', example: '⏳' },
{ key: 'full', label: 'settings.chips.full', example: 'orders.chips.pending' },
{ key: 'short', label: 'settings.chips.short', example: 'orders.chips.pendingShort' },
{ key: 'icon_full', label: 'settings.chips.iconFull', example: 'settings.chips.exIconFull' },
{ key: 'icon_short', label: 'settings.chips.iconShort', example: 'settings.chips.exIconShort' },
{ key: 'icon', label: 'settings.chips.icon', example: '⏳' },
]
// ─── Tab definitions (stub future tabs here) ──────────────────────────────────
const TABS = [
{ key: 'layout', label: 'Εμφάνιση' },
{ key: 'leitourgia', label: 'Λειτουργία' },
{ key: 'ploigisi', label: 'Πλοήγηση' },
{ key: 'personalize', label: 'Αγαπημένα' },
{ key: 'layout', label: 'settings.tabs.layout' },
{ key: 'leitourgia', label: 'settings.tabs.operation' },
{ key: 'ploigisi', label: 'shell.navigation' },
{ key: 'personalize', label: 'settings.tabs.favorites' },
]
// ─── Density option data ──────────────────────────────────────────────────────
@@ -30,37 +31,37 @@ const DENSITY_OPTIONS = [
{
key: '1x1',
label: '1×1',
desc: '4 ανά σειρά — μόνο όνομα',
desc: 'settings.density.d1x1',
preview: <Grid4 />,
},
{
key: '2x1',
label: '2×1',
desc: '2 ανά σειρά — όνομα + κατάσταση',
desc: 'settings.density.d2x1',
preview: <Grid2H />,
},
{
key: '2x2',
label: '2×2',
desc: '2 ανά σειρά — συμπαγής κάρτα',
desc: 'settings.density.d2x2',
preview: <Grid2 />,
},
{
key: '4x1',
label: '4×1',
desc: '1 ανά σειρά — οριζόντια λίστα',
desc: 'settings.density.d4x1',
preview: <Grid1H />,
},
{
key: '4x2',
label: '4×2',
desc: '1 ανά σειρά — πλήρης κάρτα',
desc: 'settings.density.d4x2',
preview: <Grid1 />,
},
{
key: '4x3',
label: '4×3',
desc: '1 ανά σειρά — κάρτα με λίστα παραγγελίας',
desc: 'settings.density.d4x3',
preview: <Grid1Detail />,
},
]
@@ -153,22 +154,23 @@ function Grid1Detail() {
const ORDER_ITEM_LAYOUT_OPTIONS = [
{
key: 'compact',
label: 'Compact',
desc: 'Μία γραμμή — συμπαγής εμφάνιση, λιγότερο ύψος',
label: 'settings.itemLayout.compact',
desc: 'settings.itemLayout.compactDesc',
},
{
key: 'expanded',
label: 'Expanded',
desc: 'Δύο γραμμές — όνομα + KDS πάνω, τιμολόγηση κάτω',
label: 'settings.itemLayout.expanded',
desc: 'settings.itemLayout.expandedDesc',
},
{
key: 'fully_detailed',
label: 'Fully Detailed',
desc: 'Πλήρης ανάλυση — όνομα, τιμές, σερβιτόρος, ώρα, options',
label: 'settings.itemLayout.full',
desc: 'settings.itemLayout.fullDesc',
},
]
function LayoutTab() {
const { t } = useTranslation('waiter')
const { density, setDensity, chipStyle, setChipStyle, kdsDisplayStyle, setKdsDisplayStyle, orderItemLayout, setOrderItemLayout, mergePersist, setMergePersist } = useTableViewStore()
const { dark, toggle } = useThemeStore()
@@ -177,8 +179,8 @@ function LayoutTab() {
{/* Chip style */}
<section>
<h2 style={sectionTitle}>Εμφάνιση chips παραγγελιών</h2>
<p style={sectionSub}>Πώς εμφανίζονται τα φίλτρα στη σελίδα Παραγγελίες.</p>
<h2 style={sectionTitle}>{t('settings.chips.title')}</h2>
<p style={sectionSub}>{t('settings.chips.sub')}</p>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, marginTop: 14 }}>
{CHIP_STYLE_OPTIONS.map(opt => {
const active = (chipStyle || 'icon_short') === opt.key
@@ -197,9 +199,9 @@ function LayoutTab() {
>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 15, fontWeight: 700, color: active ? 'var(--accent)' : 'var(--text)', marginBottom: 2 }}>
{opt.label}
{t(opt.label)}
</div>
<div style={{ fontSize: 12, color: 'var(--muted)' }}>{opt.example}</div>
<div style={{ fontSize: 12, color: 'var(--muted)' }}>{t(opt.example)}</div>
</div>
{active && (
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" style={{ flexShrink: 0, color: 'var(--accent)' }}>
@@ -215,8 +217,8 @@ function LayoutTab() {
{/* Card density */}
<section>
<h2 style={sectionTitle}>Κάρτες τραπεζιών</h2>
<p style={sectionSub}>Επίλεξε πόσα στοιχεία εμφανίζονται σε κάθε κάρτα.</p>
<h2 style={sectionTitle}>{t('settings.density.title')}</h2>
<p style={sectionSub}>{t('settings.density.sub')}</p>
<div style={{ display: 'flex', flexDirection: 'column', gap: 10, marginTop: 14 }}>
{DENSITY_OPTIONS.map(opt => {
@@ -252,10 +254,10 @@ function LayoutTab() {
color: active ? 'var(--accent)' : 'var(--text)',
marginBottom: 2,
}}>
{opt.label}
{t(opt.label)}
</div>
<div style={{ fontSize: 13, color: 'var(--muted)', lineHeight: 1.4 }}>
{opt.desc}
{t(opt.desc)}
</div>
</div>
@@ -274,12 +276,12 @@ function LayoutTab() {
{/* KDS status display */}
<section>
<h2 style={sectionTitle}>Εμφάνιση Κατάστασης KDS</h2>
<p style={sectionSub}>Πώς εμφανίζεται η κατάσταση KDS σε κάθε αντικείμενο παραγγελίας.</p>
<h2 style={sectionTitle}>{t('settings.kds.title')}</h2>
<p style={sectionSub}>{t('settings.kds.sub')}</p>
<div style={{ display: 'flex', gap: 10, marginTop: 14 }}>
{[
{ key: 'badge', label: 'Badge', desc: 'Κείμενο σε chip (ΕΚΚΡΕΜΕΙ, READY…)' },
{ key: 'icon', label: 'Εικονίδιο', desc: 'Μικρό χρωματιστό εικονίδιο — λιγότερος χώρος' },
{ key: 'badge', label: 'settings.kds.badge', desc: 'settings.kds.badgeDesc' },
{ key: 'icon', label: 'settings.kds.icon', desc: 'settings.kds.iconDesc' },
].map(opt => {
const active = (kdsDisplayStyle || 'badge') === opt.key
return (
@@ -295,8 +297,8 @@ function LayoutTab() {
transition: 'border-color 0.12s, background 0.12s',
}}
>
<span style={{ fontSize: 13, fontWeight: 800, color: active ? 'var(--accent)' : 'var(--text)' }}>{opt.label}</span>
<span style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{opt.desc}</span>
<span style={{ fontSize: 13, fontWeight: 800, color: active ? 'var(--accent)' : 'var(--text)' }}>{t(opt.label)}</span>
<span style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{t(opt.desc)}</span>
</button>
)
})}
@@ -305,8 +307,8 @@ function LayoutTab() {
{/* Order item layout */}
<section>
<h2 style={sectionTitle}>Layout Αντικειμένων Παραγγελίας</h2>
<p style={sectionSub}>Πώς εμφανίζεται κάθε αντικείμενο στη λίστα παραγγελίας ενός τραπεζιού.</p>
<h2 style={sectionTitle}>{t('settings.itemLayout.title')}</h2>
<p style={sectionSub}>{t('settings.itemLayout.sub')}</p>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, marginTop: 14 }}>
{ORDER_ITEM_LAYOUT_OPTIONS.map(opt => {
const active = (orderItemLayout || 'compact') === opt.key
@@ -325,9 +327,9 @@ function LayoutTab() {
>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 15, fontWeight: 700, color: active ? 'var(--accent)' : 'var(--text)', marginBottom: 2 }}>
{opt.label}
{t(opt.label)}
</div>
<div style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{opt.desc}</div>
<div style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{t(opt.desc)}</div>
</div>
{active && (
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" style={{ flexShrink: 0, color: 'var(--accent)' }}>
@@ -343,13 +345,13 @@ function LayoutTab() {
{/* Merge view persistence */}
<section>
<h2 style={sectionTitle}>Διατήρηση Προβολής Συγχώνευσης</h2>
<p style={sectionSub}>Πόσο διατηρείται η επιλεγμένη προβολή συγχώνευσης αντικειμένων.</p>
<h2 style={sectionTitle}>{t('settings.merge.title')}</h2>
<p style={sectionSub}>{t('settings.merge.sub')}</p>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, marginTop: 14 }}>
{[
{ key: 'off', label: 'OFF', desc: 'Επαναφορά στην αρχική κατά την πλοήγηση' },
{ key: 'per_order', label: 'ΔΙΑΤΗΡΗΣΗ ΑΝΑ ΠΑΡΑΓΓΕΛΙΑ', desc: 'Διατηρείται μέχρι το κλείσιμο της παραγγελίας' },
{ key: 'global', label: 'ΔΙΑΤΗΡΗΣΗ ΠΑΝΤΑ', desc: 'Ίδια ρύθμιση για όλα τα τραπέζια, πάντα' },
{ key: 'off', label: 'settings.merge.off', desc: 'settings.merge.offDesc' },
{ key: 'per_order', label: 'settings.merge.perOrder', desc: 'settings.merge.perOrderDesc' },
{ key: 'global', label: 'settings.merge.global', desc: 'settings.merge.globalDesc' },
].map(opt => {
const active = (mergePersist || 'off') === opt.key
return (
@@ -366,8 +368,8 @@ function LayoutTab() {
}}
>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 15, fontWeight: 700, color: active ? 'var(--accent)' : 'var(--text)', marginBottom: 2 }}>{opt.label}</div>
<div style={{ fontSize: 12, color: 'var(--muted)' }}>{opt.desc}</div>
<div style={{ fontSize: 15, fontWeight: 700, color: active ? 'var(--accent)' : 'var(--text)', marginBottom: 2 }}>{t(opt.label)}</div>
<div style={{ fontSize: 12, color: 'var(--muted)' }}>{t(opt.desc)}</div>
</div>
{active && (
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" style={{ flexShrink: 0, color: 'var(--accent)' }}>
@@ -383,12 +385,12 @@ function LayoutTab() {
{/* Theme */}
<section>
<h2 style={sectionTitle}>Θέμα</h2>
<h2 style={sectionTitle}>{t('settings.theme.title')}</h2>
<div style={{ display: 'flex', gap: 10, marginTop: 14 }}>
{[
{ key: false, icon: '☀️', label: 'Φωτεινό' },
{ key: true, icon: '🌙', label: 'Σκοτεινό' },
{ key: false, icon: '☀️', label: 'settings.theme.light' },
{ key: true, icon: '🌙', label: 'settings.theme.dark' },
].map(opt => {
const active = dark === opt.key
return (
@@ -410,7 +412,7 @@ function LayoutTab() {
<span style={{
fontSize: 14, fontWeight: 600,
color: active ? 'var(--accent)' : 'var(--muted)',
}}>{opt.label}</span>
}}>{t(opt.label)}</span>
</button>
)
})}
@@ -428,23 +430,23 @@ const sectionSub = {
fontSize: 14, color: 'var(--muted)', lineHeight: 1.5,
}
// ─── Λειτουργία tab ──────────────────────────────────────────────────────────
// ─── Operation tab ──────────────────────────────────────────────────────────
const POPUP_MODE_OPTIONS = [
{
key: 'all',
label: 'Popup Everything',
desc: 'Εμφανίζεται popup για κάθε ειδοποίηση (KDS, μηνύματα, κλπ.)',
label: 'settings.popup.all',
desc: 'settings.popup.allDesc',
},
{
key: 'manager_only',
label: 'Popup μόνο για μηνύματα διαχειριστή',
desc: 'KDS ειδοποιήσεις αποθηκεύονται στο κουδούνι χωρίς popup.',
label: 'settings.popup.manager',
desc: 'settings.popup.managerDesc',
},
{
key: 'never',
label: 'Never Popup',
desc: 'Καμία αναδυόμενη ειδοποίηση. Ανοίξτε το κουδούνι για να τις δείτε — και θα σβηστούν αυτόματα.',
label: 'settings.popup.never',
desc: 'settings.popup.neverDesc',
},
]
@@ -482,22 +484,23 @@ function ToggleRow({ label, desc, checked, onChange }) {
const PAYMENT_SAFETY_OPTIONS = [
{
key: 'off',
label: 'Απενεργοποιημένο',
desc: 'Η πληρωμή επιβεβαιώνεται με ένα απλό πάτημα.',
label: 'settings.paySafety.off',
desc: 'settings.paySafety.offDesc',
},
{
key: 'second_confirm',
label: 'Δεύτερη Επιβεβαίωση',
desc: 'Μετά την επιβεβαίωση πληρωμής, εμφανίζεται ένα επιπλέον παράθυρο ασφαλείας πριν ολοκληρωθεί η πληρωμή.',
label: 'settings.paySafety.second',
desc: 'settings.paySafety.secondDesc',
},
{
key: 'long_press',
label: 'Παρατεταμένο Πάτημα',
desc: 'Για να επιβεβαιωθεί η πληρωμή, πρέπει να κρατήσετε πατημένο το κουμπί για ~1 δευτερόλεπτο.',
label: 'settings.paySafety.hold',
desc: 'settings.paySafety.holdDesc',
},
]
function LeitourgiaTab() {
const { t } = useTranslation('waiter')
const { popupMode, persistentPopup, setPopupMode, setPersistentPopup } = useNotificationSettingsStore()
const { summaryBeforeSend, setSummaryBeforeSend } = useOrderingSettingsStore()
const { paymentSafety, setPaymentSafety } = usePaymentSettingsStore()
@@ -507,8 +510,8 @@ function LeitourgiaTab() {
{/* Popup mode */}
<section>
<h2 style={sectionTitle}>Στυλ ειδοποιήσεων</h2>
<p style={sectionSub}>Πότε εμφανίζονται αναδυόμενα banners κατά την παραλαβή ειδοποίησης.</p>
<h2 style={sectionTitle}>{t('settings.popup.title')}</h2>
<p style={sectionSub}>{t('settings.popup.sub')}</p>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, marginTop: 14 }}>
{POPUP_MODE_OPTIONS.map(opt => {
const active = popupMode === opt.key
@@ -527,9 +530,9 @@ function LeitourgiaTab() {
>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 15, fontWeight: 700, color: active ? 'var(--accent)' : 'var(--text)', marginBottom: 2 }}>
{opt.label}
{t(opt.label)}
</div>
<div style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{opt.desc}</div>
<div style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{t(opt.desc)}</div>
</div>
{active && (
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" style={{ flexShrink: 0, color: 'var(--accent)' }}>
@@ -545,16 +548,16 @@ function LeitourgiaTab() {
{/* Persistent popup */}
<section>
<h2 style={sectionTitle}>Επιμονή Popup</h2>
<h2 style={sectionTitle}>{t('settings.persist.title')}</h2>
<p style={sectionSub}>
{persistentPopup
? 'Τα popups παραμένουν μέχρι να πατήσετε OK.'
: 'Τα popups κλείνουν αυτόματα μετά από 3 δευτερόλεπτα και η ειδοποίηση σβήνεται αμέσως κατά την παραλαβή.'}
? t('settings.persist.on')
: t('settings.persist.off')}
</p>
<div style={{ marginTop: 14 }}>
<ToggleRow
label="Persistent Popup"
desc={persistentPopup ? 'Ενεργό — απαιτεί χειροκίνητο κλείσιμο' : 'Ανενεργό — αυτόματο κλείσιμο σε 3 δευτ.'}
label={t('settings.persist.label')}
desc={persistentPopup ? t('settings.persist.onDesc') : t('settings.persist.offDesc')}
checked={persistentPopup}
onChange={() => setPersistentPopup(!persistentPopup)}
/>
@@ -563,14 +566,14 @@ function LeitourgiaTab() {
{/* Summary before send */}
<section>
<h2 style={sectionTitle}>Σύνοψη πριν την Αποστολή</h2>
<h2 style={sectionTitle}>{t('settings.summary.title')}</h2>
<p style={sectionSub}>
Αντί για απευθείας αποστολή, εμφανίζεται πρώτα σελίδα επισκόπησης με όλα τα προϊόντα, τις επιλογές, και τη σημείωση παραγγελίας.
{t('settings.summary.sub')}
</p>
<div style={{ marginTop: 14 }}>
<ToggleRow
label="Σύνοψη + Αποστολή"
desc={summaryBeforeSend ? 'Ενεργό — εμφανίζεται modal επισκόπησης πριν την αποστολή' : 'Ανενεργό — άμεση αποστολή'}
label={t('settings.summary.label')}
desc={summaryBeforeSend ? t('settings.summary.onDesc') : t('settings.summary.offDesc')}
checked={summaryBeforeSend}
onChange={() => setSummaryBeforeSend(!summaryBeforeSend)}
/>
@@ -579,9 +582,9 @@ function LeitourgiaTab() {
{/* Payment safety switch */}
<section>
<h2 style={sectionTitle}>Ασφάλεια Πληρωμών</h2>
<h2 style={sectionTitle}>{t('settings.paySafety.title')}</h2>
<p style={sectionSub}>
Προσθέτει ένα επιπλέον βήμα επιβεβαίωσης για να αποφύγετε τυχαίες πληρωμές. Ακόμα κι αν κάνετε λάθος, ο διαχειριστής μπορεί να ενεργοποιήσει την αναίρεση πληρωμής.
{t('settings.paySafety.sub')}
</p>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, marginTop: 14 }}>
{PAYMENT_SAFETY_OPTIONS.map(opt => {
@@ -601,9 +604,9 @@ function LeitourgiaTab() {
>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 15, fontWeight: 700, color: active ? 'var(--accent)' : 'var(--text)', marginBottom: 2 }}>
{opt.label}
{t(opt.label)}
</div>
<div style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{opt.desc}</div>
<div style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{t(opt.desc)}</div>
</div>
{active && (
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" style={{ flexShrink: 0, color: 'var(--accent)' }}>
@@ -621,9 +624,10 @@ function LeitourgiaTab() {
)
}
// ─── Προσωπικά tab ────────────────────────────────────────────────────────────
// ─── Personal tab ────────────────────────────────────────────────────────────
function PersonalizeTab() {
const { t } = useTranslation('waiter')
const navigate = useNavigate()
const { favorites, resetAll } = useWaiterFavoritesStore()
const [confirmReset, setConfirmReset] = useState(false)
@@ -639,11 +643,11 @@ function PersonalizeTab() {
{/* Favorites setup */}
<section>
<h2 style={sectionTitle}>Αγαπημένα Προϊόντα</h2>
<h2 style={sectionTitle}>{t('settings.fav.title')}</h2>
<p style={sectionSub}>
{favorites.length > 0
? `${favorites.length} αγαπημένα ενεργά — εμφανίζονται ως πρώτη κατηγορία στο ProductPicker.`
: 'Δεν έχεις ορίσει αγαπημένα ακόμα. Πάτα παρακάτω για να ξεκινήσεις.'}
? t('settings.fav.count', { count: favorites.length })
: t('settings.fav.none')}
</p>
<div style={{ marginTop: 14 }}>
<button
@@ -660,8 +664,8 @@ function PersonalizeTab() {
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
</svg>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 15, fontWeight: 700, color: 'var(--accent)' }}>Ρύθμιση Αγαπημένων</div>
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 2 }}>Επίλεξε προϊόντα και άλλαξε σειρά εμφάνισης</div>
<div style={{ fontSize: 15, fontWeight: 700, color: 'var(--accent)' }}>{t('settings.fav.setup')}</div>
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 2 }}>{t('settings.fav.setupSub')}</div>
</div>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" style={{ color: 'var(--accent)', flexShrink: 0 }}>
<path d="M9 18l6-6-6-6" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/>
@@ -672,11 +676,11 @@ function PersonalizeTab() {
{/* Reset all */}
<section>
<h2 style={sectionTitle}>Επαναφορά</h2>
<h2 style={sectionTitle}>{t('settings.reset.title')}</h2>
<p style={sectionSub}>
{confirmReset
? 'Είσαι σίγουρος; Αυτή η ενέργεια δεν μπορεί να αναιρεθεί.'
: 'Διαγράφει όλα τα αγαπημένα και επαναφέρει τις προτιμήσεις στις εργοστασιακές τιμές.'}
? t('settings.reset.sure')
: t('settings.reset.sub')}
</p>
<div style={{ marginTop: 14 }}>
<button
@@ -696,9 +700,9 @@ function PersonalizeTab() {
</svg>
<div style={{ flex: 1 }}>
<div style={{ fontSize: 15, fontWeight: 700, color: confirmReset ? 'var(--danger)' : 'var(--text)' }}>
{confirmReset ? 'Πάτα ξανά για επιβεβαίωση' : 'Επαναφορά Όλων'}
{confirmReset ? t('settings.reset.again') : t('settings.reset.all')}
</div>
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 2 }}>Αγαπημένα & ρυθμίσεις</div>
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 2 }}>{t('settings.reset.allSub')}</div>
</div>
</button>
</div>
@@ -708,12 +712,12 @@ function PersonalizeTab() {
)
}
// ─── Πλοήγηση tab ─────────────────────────────────────────────────────────────
// ─── Navigation tab ─────────────────────────────────────────────────────────────
const ALL_NAV_ITEMS = [
{
key: 'tables',
label: 'Τραπέζια',
label: 'nav.tables',
icon: (
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<rect x="3" y="3" width="7" height="7" rx="1.5" fill="currentColor"/>
@@ -725,7 +729,7 @@ const ALL_NAV_ITEMS = [
},
{
key: 'orders',
label: 'Παραγγελίες',
label: 'nav.orders',
icon: (
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<path d="M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2" stroke="currentColor" strokeWidth="2" strokeLinecap="round"/>
@@ -735,7 +739,7 @@ const ALL_NAV_ITEMS = [
},
{
key: 'messages',
label: 'Chat',
label: 'nav.chat',
icon: (
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
@@ -744,7 +748,7 @@ const ALL_NAV_ITEMS = [
},
{
key: 'standalone',
label: 'Takeaway',
label: 'nav.takeaway',
icon: (
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<path d="M5 12H3l9-9 9 9h-2" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
@@ -755,7 +759,7 @@ const ALL_NAV_ITEMS = [
},
{
key: 'shift-overview',
label: 'Βάρδια',
label: 'nav.shift',
icon: (
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="12" r="9" stroke="currentColor" strokeWidth="2"/>
@@ -765,7 +769,7 @@ const ALL_NAV_ITEMS = [
},
{
key: 'order-log',
label: 'Αρχείο',
label: 'nav.log',
icon: (
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<path d="M6 9V2h12v7" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
@@ -806,6 +810,7 @@ function Checkbox({ checked }) {
}
function PloigisiTab() {
const { t } = useTranslation('waiter')
const { navStyle, setNavStyle, navItems, setNavItems, tripleItems, setTripleItems } = useTableViewStore()
const NAV_MAP = Object.fromEntries(ALL_NAV_ITEMS.map(i => [i.key, i]))
@@ -917,12 +922,12 @@ function PloigisiTab() {
{/* Nav style picker */}
<section>
<h2 style={sectionTitle}>Στυλ γραμμής πλοήγησης</h2>
<p style={sectionSub}>Πώς εμφανίζεται η γραμμή πλοήγησης στο κάτω μέρος της οθόνης.</p>
<h2 style={sectionTitle}>{t('settings.navStyle.title')}</h2>
<p style={sectionSub}>{t('settings.navStyle.sub')}</p>
<div style={{ display: 'flex', gap: 10, marginTop: 14 }}>
{[
{ key: 'triple', label: 'Triple Pill', desc: 'Σταθερά 3 κουμπιά με εικονίδιο + κείμενο σε pill μορφή' },
{ key: 'icon_navbar', label: 'Icon Navbar', desc: 'Android-style με 1–5 εικονίδια που μπορείτε να διαμορφώσετε' },
{ key: 'triple', label: 'settings.navStyle.triple', desc: 'settings.navStyle.tripleDesc' },
{ key: 'icon_navbar', label: 'settings.navStyle.icons', desc: 'settings.navStyle.iconsDesc' },
].map(opt => {
const active = navStyle === opt.key
return (
@@ -939,8 +944,8 @@ function PloigisiTab() {
transition: 'border-color 0.12s, background 0.12s',
}}
>
<span style={{ fontSize: 13, fontWeight: 800, color: active ? 'var(--accent)' : 'var(--text)' }}>{opt.label}</span>
<span style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{opt.desc}</span>
<span style={{ fontSize: 13, fontWeight: 800, color: active ? 'var(--accent)' : 'var(--text)' }}>{t(opt.label)}</span>
<span style={{ fontSize: 12, color: 'var(--muted)', lineHeight: 1.4 }}>{t(opt.desc)}</span>
</button>
)
})}
@@ -950,8 +955,8 @@ function PloigisiTab() {
{/* Triple Pill item editor */}
{navStyle === 'triple' && (
<section>
<h2 style={sectionTitle}>Στοιχεία Triple Pill</h2>
<p style={sectionSub}>Επίλεξε ακριβώς 3 κουμπιά και σύρε για να αλλάξεις τη σειρά τους.</p>
<h2 style={sectionTitle}>{t('settings.triple.title')}</h2>
<p style={sectionSub}>{t('settings.triple.sub')}</p>
<div
style={{ display: 'flex', flexDirection: 'column', gap: 0, marginTop: 14 }}
@@ -986,7 +991,7 @@ function PloigisiTab() {
>
<DragHandle />
<span style={{ color: 'var(--accent)', flexShrink: 0 }}>{item.icon}</span>
<span style={{ flex: 1, fontSize: 15, fontWeight: 700, color: 'var(--accent)' }}>{item.label}</span>
<span style={{ flex: 1, fontSize: 15, fontWeight: 700, color: 'var(--accent)' }}>{t(item.label)}</span>
<button
onClick={() => toggleTripleItem(item.key)}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 0 }}
@@ -1010,7 +1015,7 @@ function PloigisiTab() {
<div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '4px 0', margin: '4px 0 8px' }}>
<div style={{ flex: 1, height: 1, background: 'var(--border)' }} />
<span style={{ fontSize: 11, color: 'var(--muted)', fontWeight: 700, textTransform: 'uppercase', letterSpacing: 0.8 }}>
Διαθέσιμα
{t('settings.available')}
</span>
<div style={{ flex: 1, height: 1, background: 'var(--border)' }} />
</div>
@@ -1026,7 +1031,7 @@ function PloigisiTab() {
>
<span style={{ width: 20, flexShrink: 0 }} />
<span style={{ color: 'var(--muted)', flexShrink: 0 }}>{item.icon}</span>
<span style={{ flex: 1, fontSize: 15, fontWeight: 700, color: 'var(--text)' }}>{item.label}</span>
<span style={{ flex: 1, fontSize: 15, fontWeight: 700, color: 'var(--text)' }}>{t(item.label)}</span>
<button
onClick={() => toggleTripleItem(item.key)}
style={{ background: 'none', border: 'none', cursor: tripleItems.length >= 3 ? 'not-allowed' : 'pointer', padding: 0, opacity: tripleItems.length >= 3 ? 0.4 : 1 }}
@@ -1039,8 +1044,8 @@ function PloigisiTab() {
)}
<p style={{ fontSize: 12, color: 'var(--muted)', marginTop: 4, lineHeight: 1.5 }}>
{tripleItems.length}/3 κουμπιά ενεργά
{tripleItems.length >= 3 ? ' — μέγιστο' : ''}
{t('settings.triple.count', { count: tripleItems.length })}
{tripleItems.length >= 3 ? ` — ${t('settings.max')}` : ''}
</p>
</section>
)}
@@ -1048,8 +1053,8 @@ function PloigisiTab() {
{/* Icon navbar item editor */}
{navStyle === 'icon_navbar' && (
<section>
<h2 style={sectionTitle}>Στοιχεία Icon Navbar</h2>
<p style={sectionSub}>Επίλεξε ποια εικονίδια εμφανίζονται (1–5). Σύρε για να αλλάξεις τη σειρά.</p>
<h2 style={sectionTitle}>{t('settings.icons.title')}</h2>
<p style={sectionSub}>{t('settings.icons.sub')}</p>
<div
style={{ display: 'flex', flexDirection: 'column', gap: 0, marginTop: 14 }}
@@ -1088,7 +1093,7 @@ function PloigisiTab() {
>
<DragHandle />
<span style={{ color: 'var(--accent)', flexShrink: 0 }}>{item.icon}</span>
<span style={{ flex: 1, fontSize: 15, fontWeight: 700, color: 'var(--accent)' }}>{item.label}</span>
<span style={{ flex: 1, fontSize: 15, fontWeight: 700, color: 'var(--accent)' }}>{t(item.label)}</span>
<button
onClick={() => toggleItem(item.key)}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 0 }}
@@ -1112,7 +1117,7 @@ function PloigisiTab() {
<div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '4px 0', marginBottom: 8 }}>
<div style={{ flex: 1, height: 1, background: 'var(--border)' }} />
<span style={{ fontSize: 11, color: 'var(--muted)', fontWeight: 700, textTransform: 'uppercase', letterSpacing: 0.8 }}>
Διαθέσιμα
{t('settings.available')}
</span>
<div style={{ flex: 1, height: 1, background: 'var(--border)' }} />
</div>
@@ -1131,7 +1136,7 @@ function PloigisiTab() {
>
<span style={{ width: 20, flexShrink: 0 }} />
<span style={{ color: 'var(--muted)', flexShrink: 0 }}>{item.icon}</span>
<span style={{ flex: 1, fontSize: 15, fontWeight: 700, color: 'var(--text)' }}>{item.label}</span>
<span style={{ flex: 1, fontSize: 15, fontWeight: 700, color: 'var(--text)' }}>{t(item.label)}</span>
<button
onClick={() => toggleItem(item.key)}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 0 }}
@@ -1143,8 +1148,8 @@ function PloigisiTab() {
</div>
<p style={{ fontSize: 12, color: 'var(--muted)', marginTop: 4, lineHeight: 1.5 }}>
{navItems.length}/5 εικονίδια ενεργά
{navItems.length >= 5 ? ' — μέγιστο' : ''}
{t('settings.icons.count', { count: navItems.length })}
{navItems.length >= 5 ? ` — ${t('settings.max')}` : ''}
</p>
</section>
)}
@@ -1156,6 +1161,7 @@ function PloigisiTab() {
// ─── Main page ────────────────────────────────────────────────────────────────
export default function SettingsPage() {
const { t } = useTranslation('waiter')
const navigate = useNavigate()
const [activeTab, setActiveTab] = useState('layout')
@@ -1175,9 +1181,9 @@ export default function SettingsPage() {
<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
<path d="M12.5 15l-5-5 5-5" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/>
</svg>
Πίσω
{t('common.back')}
</button>
<span className="top-bar__title" style={{ textAlign: 'center' }}>Ρυθμίσεις</span>
<span className="top-bar__title" style={{ textAlign: 'center' }}>{t('nav.settings')}</span>
{/* spacer to balance the back button */}
<div style={{ width: 72 }} />
</header>
@@ -1208,7 +1214,7 @@ export default function SettingsPage() {
transition: 'color 0.12s',
}}
>
{tab.label}
{t(tab.label)}
</button>
))}
</div>