feat(waiter): English-first texts, part c: shift, log, chat, offline, notifications; language switch; guard (platform-v2 step 4.5c)
- Shift overview, order log, chat list / thread, offline + server search + rediscovery screens, notifications, the refused-lines sheet and the offline queue's reasons become keys; times and dates through useFormat() in the venue's clock. - User menu: the other language(s) (data-testid menu-language-<lng>), saved to the person's profile (PATCH /api/auth/me) and the bootstrap reloaded (D-12). - tests/no-greek.test.mjs: no Greek letter in waiter_pwa/src (the one Greek word the app recognises in staff messages is a \u escape). - e2e: the test venue is English: waiter / browser / android use the English texts; waiter.mjs +3 (English by default, switch to Greek at once and saved, after reload); android bundle checks print what they saw when they fail. - Pack README: the waiter texts rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,11 +2,13 @@ import client from '../api/client'
|
||||
import { deliveryMode } from '../config/server'
|
||||
import { canRediscover, rediscover } from '../native/autoRediscover'
|
||||
import { useState } from 'react'
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
|
||||
// Shown at /offline, and (plan step 4.1) instead of the whole app when the server can't be
|
||||
// reached on a start with no cached bootstrap (the app retries by itself and then opens the
|
||||
// screen the address asks for).
|
||||
export default function OfflinePage() {
|
||||
const { t } = useTranslation('waiter')
|
||||
const [checking, setChecking] = useState(false)
|
||||
const [search, setSearch] = useState(null) // null | { done, total } | 'not-found'
|
||||
|
||||
@@ -37,12 +39,12 @@ export default function OfflinePage() {
|
||||
<div className="page page--centered">
|
||||
<div style={{ textAlign: 'center', maxWidth: 300 }}>
|
||||
<p style={{ fontSize: 48, marginBottom: 16 }}>📡</p>
|
||||
<h2 style={{ color: '#e2e8f0', marginBottom: 8 }}>Δεν υπάρχει σύνδεση</h2>
|
||||
<h2 style={{ color: '#e2e8f0', marginBottom: 8 }}>{t('offline.title')}</h2>
|
||||
<p style={{ color: '#64748b', marginBottom: 32 }}>
|
||||
Δεν είναι δυνατή η επικοινωνία με το σύστημα. Ελέγξτε τη σύνδεση WiFi.
|
||||
{t('offline.body')}
|
||||
</p>
|
||||
<button className="btn btn--primary btn--lg" onClick={retry} disabled={checking || searching}>
|
||||
{checking ? 'Έλεγχος…' : 'Επανάληψη'}
|
||||
{checking ? t('venues.checking') : t('common.retry')}
|
||||
</button>
|
||||
{canRediscover() && (
|
||||
<button
|
||||
@@ -51,12 +53,12 @@ export default function OfflinePage() {
|
||||
onClick={searchNetwork}
|
||||
disabled={searching}
|
||||
>
|
||||
{searching ? `Αναζήτηση… ${search.done}/${search.total}` : 'Αναζήτηση server στο δίκτυο'}
|
||||
{searching ? t('offline.searching', { done: search.done, total: search.total }) : t('offline.search')}
|
||||
</button>
|
||||
)}
|
||||
{search === 'not-found' && (
|
||||
<p style={{ color: '#94a3b8', fontSize: 13, marginTop: 12, lineHeight: 1.45 }}>
|
||||
Ο server δεν βρέθηκε στο δίκτυο. Ελέγξτε ότι είναι αναμμένος, ή σαρώστε ξανά το QR από τον διαχειριστή.
|
||||
{t('offline.notFound')}
|
||||
</p>
|
||||
)}
|
||||
{deliveryMode() === 'native' && (
|
||||
@@ -66,7 +68,7 @@ export default function OfflinePage() {
|
||||
onClick={() => { window.location.href = '/venues' }}
|
||||
disabled={searching}
|
||||
>
|
||||
Αλλαγή καταστήματος
|
||||
{t('offline.changeVenue')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user