From f383060badaaf1ba76bf3c9a299692a49bf7ba0d Mon Sep 17 00:00:00 2001 From: bonamin Date: Thu, 19 Nov 2026 20:11:34 +0200 Subject: [PATCH] feat(ui): the QR card shared in @xenia/ui/qr (platform-v2 step 6.14c) - QrCode (a QR on a light tile, optional caption; framed or not) in packages/ui, on its own subpath so only the apps that show one need qrcode.react (an optional peer); x-qr styles keep the code dark on light in dark themes - used by the terminal's customer display, the manager's online-ordering link, table QR codes and Settings' pairing QR (four copies of the same markup gone) - the money pad and the order line row stay where they are: the manager's payment is the phones' cash / card choice (no cash given, change or split) and its order lines are not the counter's cart lines, so neither has a second user; the signage slides keep their own QR (inline styles scaled to the TV) Co-Authored-By: Claude Opus 5.5 --- .../Settings/sections/SystemSettings.jsx | 10 ++++----- .../src/pages/online/OrderingLink.jsx | 4 ++-- .../src/pages/online/QrCodesPage.jsx | 4 ++-- packages/ui/package.json | 11 ++++++++-- packages/ui/src/components.css | 6 ++++++ packages/ui/src/components/QrCode.jsx | 21 +++++++++++++++++++ .../customer-display/CustomerDisplayApp.jsx | 4 ++-- 7 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 packages/ui/src/components/QrCode.jsx diff --git a/manager_dashboard/src/pages/Settings/sections/SystemSettings.jsx b/manager_dashboard/src/pages/Settings/sections/SystemSettings.jsx index 14f769f..d46a637 100644 --- a/manager_dashboard/src/pages/Settings/sections/SystemSettings.jsx +++ b/manager_dashboard/src/pages/Settings/sections/SystemSettings.jsx @@ -6,12 +6,12 @@ import { useState } from 'react' import { useMutation, useQueryClient } from '@tanstack/react-query' import toast from 'react-hot-toast' -import { QRCodeSVG } from 'qrcode.react' -import { Lock, LockOpen, QrCode, RefreshCw } from 'lucide-react' +import { Lock, LockOpen, QrCode as QrIcon, RefreshCw } from 'lucide-react' import { useAccess } from '@xenia/access' import { errorMessage } from '@xenia/api' import { useFormat, useTranslation } from '@xenia/i18n' import { Button, Dialog, Input, Spinner } from '@xenia/ui' +import { QrCode } from '@xenia/ui/qr' import client from '../../../api/client' import { useLiveQuery } from '../../../live/useLiveQuery' import { Pill } from '../../overview/parts' @@ -67,7 +67,7 @@ export default function SystemSettings() { {status?.waiter_domain && ( {status.waiter_domain} - + )} @@ -101,7 +101,7 @@ export default function SystemSettings() { setQr(null)} title={t('settings.system.qrTitle')} description={qr.caption} footer={}>
-
+

{qr.url}

@@ -155,7 +155,7 @@ function LanAccess({ status, onQr }) { http://{ip} - diff --git a/manager_dashboard/src/pages/online/OrderingLink.jsx b/manager_dashboard/src/pages/online/OrderingLink.jsx index 9354048..c490b29 100644 --- a/manager_dashboard/src/pages/online/OrderingLink.jsx +++ b/manager_dashboard/src/pages/online/OrderingLink.jsx @@ -3,10 +3,10 @@ // as a QR code for flyers and the shop window. GET /api/connect/fees → links.order (the cloud // tells the venue where the customer apps live: PUBLIC_APPS_URL, sent with the heartbeat). import toast from 'react-hot-toast' -import { QRCodeSVG } from 'qrcode.react' import { Copy, ExternalLink, Printer } from 'lucide-react' import { useTranslation } from '@xenia/i18n' import { Button } from '@xenia/ui' +import { QrCode } from '@xenia/ui/qr' export default function OrderingLink({ url }) { const { t } = useTranslation('manager') @@ -15,7 +15,7 @@ export default function OrderingLink({ url }) { } return (
-
+

{t('orderingLink.intro')}

diff --git a/manager_dashboard/src/pages/online/QrCodesPage.jsx b/manager_dashboard/src/pages/online/QrCodesPage.jsx index 1bfd90d..034d6e7 100644 --- a/manager_dashboard/src/pages/online/QrCodesPage.jsx +++ b/manager_dashboard/src/pages/online/QrCodesPage.jsx @@ -6,11 +6,11 @@ // Backend: /api/connect/qr (connect_menu.manage), services/table_qr.py. import { useCallback, useEffect, useState } from 'react' import toast from 'react-hot-toast' -import { QRCodeSVG } from 'qrcode.react' import { Printer, RefreshCw } from 'lucide-react' import { errorMessage } from '@xenia/api' import { useTranslation } from '@xenia/i18n' import { Button, Dialog, EmptyState, Spinner, Switch } from '@xenia/ui' +import { QrCode } from '@xenia/ui/qr' import client from '../../api/client' export default function QrCodesPage() { @@ -60,7 +60,7 @@ export default function QrCodesPage() {
  • {t('qr.table', { name: tb.name })} {tb.group && {tb.group}} - + {t(data.ordering ? 'qr.scanOrder' : 'qr.scanRead')}