weiterer fortschritt mit tamagui und dem neuen mobile event admin

This commit is contained in:
Codex Agent
2025-12-10 20:01:47 +01:00
parent 73e550ee87
commit 7b01a77083
26 changed files with 761 additions and 139 deletions

View File

@@ -5,14 +5,12 @@ import { Download, Share2, ChevronRight, RefreshCcw } from 'lucide-react';
import { YStack, XStack } from '@tamagui/stacks';
import { SizableText as Text } from '@tamagui/text';
import { Pressable } from '@tamagui/react-native-web-lite';
import { MobileScaffold } from './components/Scaffold';
import { MobileShell } from './components/MobileShell';
import { MobileCard, CTAButton, PillBadge } from './components/Primitives';
import { BottomNav } from './components/BottomNav';
import { TenantEvent, getEvent, getEventQrInvites, createQrInvite } from '../api';
import { isAuthError } from '../auth/tokens';
import { getApiErrorMessage } from '../lib/apiError';
import toast from 'react-hot-toast';
import { useMobileNav } from './hooks/useMobileNav';
import { MobileSheet } from './components/Sheet';
const LAYOUTS = [
@@ -33,7 +31,6 @@ export default function MobileQrPrintPage() {
const [loading, setLoading] = React.useState(true);
const [paperSize, setPaperSize] = React.useState('A4 (210 x 297 mm)');
const [qrUrl, setQrUrl] = React.useState<string>('');
const { go } = useMobileNav(slug);
const [showPaperSheet, setShowPaperSheet] = React.useState(false);
const [showLayoutSheet, setShowLayoutSheet] = React.useState(false);
@@ -59,17 +56,15 @@ export default function MobileQrPrintPage() {
}, [slug, t]);
return (
<MobileScaffold
<MobileShell
activeTab="home"
title={t('events.qr.title', 'QR Code & Print Layouts')}
onBack={() => navigate(-1)}
rightSlot={
headerActions={
<Pressable onPress={() => window.location.reload()}>
<RefreshCcw size={18} color="#0f172a" />
</Pressable>
}
footer={
<BottomNav active="home" onNavigate={go} />
}
>
{error ? (
<MobileCard>
@@ -124,7 +119,8 @@ export default function MobileQrPrintPage() {
label={t('events.qr.share', 'Share')}
onPress={async () => {
try {
await navigator.clipboard.writeText(qrUrl || event?.public_url || '');
const shareUrl = String(qrUrl || (event as any)?.public_url || '');
await navigator.clipboard.writeText(shareUrl);
toast.success(t('events.qr.shareSuccess', 'Link kopiert'));
} catch {
toast.error(t('events.qr.shareFailed', 'Konnte Link nicht kopieren'));
@@ -200,7 +196,8 @@ export default function MobileQrPrintPage() {
onPress={async () => {
if (!slug) return;
try {
const invite = await createQrInvite(slug, { label: 'Mobile Link' });
if (!slug) return;
const invite = await createQrInvite(slug, { label: 'Mobile Link' });
setQrUrl(invite.url);
toast.success(t('events.qr.created', 'Neuer QR-Link erstellt'));
} catch (err) {
@@ -265,6 +262,6 @@ export default function MobileQrPrintPage() {
))}
</YStack>
</MobileSheet>
</MobileScaffold>
</MobileShell>
);
}