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 <noreply@anthropic.com>
This commit is contained in:
@@ -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 && (
|
||||
<SettingRow label={t('settings.system.oldDomain')} hint={t('settings.system.oldDomainHint')}>
|
||||
<span className="flex items-center gap-2 text-label font-mono break-all">{status.waiter_domain}
|
||||
<Button size="sm" variant="secondary" icon={<QrCode size={14} />} onClick={() => setQr({ url: status.waiter_domain })}>{t('settings.system.qr')}</Button>
|
||||
<Button size="sm" variant="secondary" icon={<QrIcon size={14} />} onClick={() => setQr({ url: status.waiter_domain })}>{t('settings.system.qr')}</Button>
|
||||
</span>
|
||||
</SettingRow>
|
||||
)}
|
||||
@@ -101,7 +101,7 @@ export default function SystemSettings() {
|
||||
<Dialog open size="sm" onClose={() => setQr(null)} title={t('settings.system.qrTitle')} description={qr.caption}
|
||||
footer={<Button variant="secondary" onClick={() => setQr(null)}>{t('settings.back')}</Button>}>
|
||||
<div className="grid justify-items-center gap-3" data-testid="system-qr">
|
||||
<div className="p-3 rounded-card bg-surface border border-line"><QRCodeSVG value={qr.url} size={220} /></div>
|
||||
<QrCode value={qr.url} size={220} />
|
||||
<p className="text-caption font-mono text-ink-2 break-all text-center">{qr.url}</p>
|
||||
</div>
|
||||
</Dialog>
|
||||
@@ -155,7 +155,7 @@ function LanAccess({ status, onQr }) {
|
||||
<SettingRow label={t('settings.lan.waiters')} hint={t('settings.lan.waitersHint')}>
|
||||
<span className="flex flex-wrap items-center gap-2">
|
||||
<span className="font-mono text-label text-ink break-all">http://{ip}</span>
|
||||
<Button size="sm" variant="secondary" icon={<QrCode size={14} />} data-testid="lan-qr"
|
||||
<Button size="sm" variant="secondary" icon={<QrIcon size={14} />} data-testid="lan-qr"
|
||||
onClick={() => onQr({ url: waiterPairUrl(ip, status?.site_id, status?.tls?.spki_sha256), caption: t('settings.lan.qrCaption') })}>{t('settings.system.qr')}</Button>
|
||||
</span>
|
||||
</SettingRow>
|
||||
|
||||
Reference in New Issue
Block a user