From 3e3635491687f982fef9c742cfa1e01483c67406 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Tue, 13 Jan 2026 10:52:50 +0100 Subject: [PATCH] Restructure photobooth page flow --- .../js/admin/i18n/locales/de/management.json | 13 + .../js/admin/i18n/locales/en/management.json | 13 + .../js/admin/mobile/EventPhotoboothPage.tsx | 272 ++++++++---------- 3 files changed, 144 insertions(+), 154 deletions(-) diff --git a/resources/js/admin/i18n/locales/de/management.json b/resources/js/admin/i18n/locales/de/management.json index 0ddaf7b..17c2309 100644 --- a/resources/js/admin/i18n/locales/de/management.json +++ b/resources/js/admin/i18n/locales/de/management.json @@ -1208,6 +1208,19 @@ "uploader": { "hint": "POST mit Mediendatei oder base64-Feld \"media\"; die App nutzt diese Zugangsdaten." }, + "steps": { + "activate": { + "title": "1. Photobooth aktivieren", + "description": "Schalte den Upload-Zugang fuer dieses Event frei." + }, + "download": { + "title": "2. Uploader App herunterladen" + }, + "access": { + "title": "3. Verbindungscode erstellen", + "description": "Der Code verbindet die App sicher mit deinem Event." + } + }, "uploaderDownload": { "title": "Fotospiel Uploader App", "description": "Die Fotospiel Uploader App wird benötigt, damit Uploads stabil laufen, die Zugangsdaten geschützt bleiben und keine Dateien verloren gehen.", diff --git a/resources/js/admin/i18n/locales/en/management.json b/resources/js/admin/i18n/locales/en/management.json index 675feb2..95f0ad7 100644 --- a/resources/js/admin/i18n/locales/en/management.json +++ b/resources/js/admin/i18n/locales/en/management.json @@ -921,6 +921,19 @@ "uploader": { "hint": "POST with media file or base64 \"media\" field; app uses these credentials." }, + "steps": { + "activate": { + "title": "1. Activate photobooth", + "description": "Enable upload access for this event." + }, + "download": { + "title": "2. Download uploader app" + }, + "access": { + "title": "3. Generate connect code", + "description": "The code securely pairs the app with your event." + } + }, "uploaderDownload": { "title": "Fotospiel Uploader App", "description": "The Fotospiel Uploader App is required so uploads stay stable, credentials remain protected, and no files are lost.", diff --git a/resources/js/admin/mobile/EventPhotoboothPage.tsx b/resources/js/admin/mobile/EventPhotoboothPage.tsx index 5b9e3f8..8d56405 100644 --- a/resources/js/admin/mobile/EventPhotoboothPage.tsx +++ b/resources/js/admin/mobile/EventPhotoboothPage.tsx @@ -1,10 +1,9 @@ import React from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { RefreshCcw, PlugZap, RefreshCw, ShieldCheck, Copy, Power, Clock3, Mail } from 'lucide-react'; +import { RefreshCcw, PlugZap, RefreshCw, ShieldCheck, Copy, Power, Clock3, Mail, Download } from 'lucide-react'; import { YStack, XStack } from '@tamagui/stacks'; import { SizableText as Text } from '@tamagui/text'; -import { Switch } from '@tamagui/switch'; import { Pressable } from '@tamagui/react-native-web-lite'; import { MobileShell, HeaderActionButton } from './components/MobileShell'; import { MobileCard, CTAButton, PillBadge, SkeletonCard } from './components/Primitives'; @@ -172,15 +171,6 @@ export default function MobileEventPhotoboothPage() { const isActive = Boolean(status?.enabled); const title = t('photobooth.title', 'Photobooth'); - const handleToggle = (checked: boolean) => { - if (!slug || updating) return; - if (checked) { - void handleEnable(); - } else { - void handleDisable(); - } - }; - return ( - - - - {t('photobooth.title', 'Photobooth')} - - - {t('photobooth.credentials.description', 'Share these credentials with your photobooth software.')} - - - {t('photobooth.mode.active', 'Current: {{mode}}', { mode: modeLabel })} - - - - - {isActive ? t('photobooth.status.badgeActive', 'ACTIVE') : t('photobooth.status.badgeInactive', 'INACTIVE')} - - - - {isActive ? t('common.enabled', 'Enabled') : t('common.disabled', 'Disabled')} - - - - - - - - - - - {t('photobooth.stats.lastUpload', 'Last upload')} - - - {lastUploadAt ? formatEventDate(lastUploadAt, locale) : t('photobooth.status.never', 'Never')} - - - - - {t('photobooth.status.expires', 'Access expires')} - - - {expiresAt ? formatEventDate(expiresAt, locale) : '—'} - - + + + {t('photobooth.steps.activate.title', '1. Photobooth aktivieren')} + + + {t('photobooth.steps.activate.description', 'Schalte den Upload-Zugang fuer dieses Event frei.')} + - - - - - {t('photobooth.selector.title', 'Connection')} - - - {t('photobooth.selector.description', 'Use the Fotospiel uploader app for HTTP uploads.')} - - - - - - {t('photobooth.uploaderDownload.title', 'Fotospiel Uploader App')} - - - {t( - 'photobooth.uploaderDownload.description', - 'Die Fotospiel Uploader App ist verpflichtend, damit Uploads stabil laufen, die Zugangsdaten geschützt bleiben und keine Dateien verloren gehen.' - )} - - } - disabled={sendingEmail} - /> - { - const url = new URL('/downloads/PhotoboothUploader-win-x64.exe', window.location.origin).toString(); - window.open(url, '_blank', 'noopener,noreferrer'); - }} - /> - { - const url = new URL('/downloads/PhotoboothUploader-macos-x64', window.location.origin).toString(); - window.open(url, '_blank', 'noopener,noreferrer'); - }} - /> - { - const url = new URL('/downloads/PhotoboothUploader-linux-x64', window.location.origin).toString(); - window.open(url, '_blank', 'noopener,noreferrer'); - }} - /> - - - - - - {t('photobooth.credentials.uploaderTitle', 'Uploader App (HTTP)')} + + + {isActive ? t('photobooth.status.badgeActive', 'ACTIVE') : t('photobooth.status.badgeInactive', 'INACTIVE')} + + + {t('photobooth.mode.active', 'Current: {{mode}}', { mode: modeLabel })} - - handleRotate()} - iconLeft={} - disabled={updating} - style={{ width: '100%', paddingHorizontal: 10, paddingVertical: 10 }} - /> + (isActive ? handleDisable() : handleEnable())} tone={isActive ? 'ghost' : 'primary'} iconLeft={isActive ? : } disabled={updating} - style={{ width: '100%', paddingHorizontal: 10, paddingVertical: 10 }} + fullWidth={false} /> - - - {t('photobooth.connectCode.description', 'Create a 6-digit code for the uploader app.')} - + {isActive ? ( } - disabled={!isActive || updating || connectLoading} - style={{ width: '100%', paddingHorizontal: 10, paddingVertical: 10 }} + label={t('photobooth.actions.rotate', 'Regenerate access')} + onPress={() => handleRotate()} + tone="ghost" + iconLeft={} + disabled={updating} + fullWidth={false} /> - {connectCode ? ( - - ) : null} - {connectExpiresAt ? ( - - {t('photobooth.connectCode.expires', 'Expires: {{date}}', { - date: formatEventDateTime(connectExpiresAt, locale), - })} - - ) : null} - + ) : null} + + + + + + + {t('photobooth.steps.download.title', '2. Uploader App herunterladen')} + + + {t( + 'photobooth.uploaderDownload.description', + 'Die Fotospiel Uploader App ist verpflichtend, damit Uploads stabil laufen, die Zugangsdaten geschuetzt bleiben und keine Dateien verloren gehen.' + )} + + + + { + const url = new URL('/downloads/PhotoboothUploader-win-x64.exe', window.location.origin).toString(); + window.open(url, '_blank', 'noopener,noreferrer'); + }} + iconLeft={} + fullWidth={false} + /> + { + const url = new URL('/downloads/PhotoboothUploader-macos-x64', window.location.origin).toString(); + window.open(url, '_blank', 'noopener,noreferrer'); + }} + fullWidth={false} + /> + { + const url = new URL('/downloads/PhotoboothUploader-linux-x64', window.location.origin).toString(); + window.open(url, '_blank', 'noopener,noreferrer'); + }} + fullWidth={false} + /> + + + } + disabled={sendingEmail} + fullWidth={false} + /> + + + + + + + {t('photobooth.steps.access.title', '3. Verbindungscode erstellen')} + + + {t('photobooth.steps.access.description', 'Der Code verbindet die App sicher mit deinem Event.')} + + + + } + disabled={!isActive || updating || connectLoading} + fullWidth={false} + /> setShowCredentials((current) => !current)} + fullWidth={false} /> + + + {connectCode ? ( + + ) : null} + {connectExpiresAt ? ( + + {t('photobooth.connectCode.expires', 'Expires: {{date}}', { + date: formatEventDateTime(connectExpiresAt, locale), + })} + + ) : null} {showCredentials ? (