Navigation now feels more “app‑like” with
stateful tabs and reliable back behavior, and a full onboarding flow is wired in with conditional package selection
(skips when an active package exists).
What changed
- Added per‑tab history + back navigation fallback to make tab switching/Back feel native (resources/js/admin/mobile/
lib/tabHistory.ts, resources/js/admin/mobile/hooks/useBackNavigation.ts, resources/js/admin/mobile/hooks/
useMobileNav.ts, resources/js/admin/mobile/components/MobileShell.tsx + updates across mobile pages).
- Implemented onboarding flow pages + shared shell, and wired new routes/prefetch (resources/js/admin/mobile/welcome/
WelcomeLandingPage.tsx, resources/js/admin/mobile/welcome/WelcomePackagesPage.tsx, resources/js/admin/mobile/
welcome/WelcomeSummaryPage.tsx, resources/js/admin/mobile/welcome/WelcomeEventPage.tsx, resources/js/admin/mobile/
components/OnboardingShell.tsx, resources/js/admin/router.tsx, resources/js/admin/mobile/prefetch.ts).
- Conditional package step: packages page redirects to event setup if activePackage exists; selection stored locally
for summary (resources/js/admin/mobile/lib/onboardingSelection.ts, resources/js/admin/mobile/welcome/
WelcomePackagesPage.tsx).
- Added a “Start welcome journey” CTA in the empty dashboard state (resources/js/admin/mobile/DashboardPage.tsx).
- Added translations for onboarding shell + selected package + dashboard CTA (resources/js/admin/i18n/locales/en/
onboarding.json, resources/js/admin/i18n/locales/de/onboarding.json, resources/js/admin/i18n/locales/en/
management.json, resources/js/admin/i18n/locales/de/management.json).
- Tests for new helpers/hooks (resources/js/admin/mobile/lib/tabHistory.test.ts, resources/js/admin/mobile/lib/
onboardingSelection.test.ts, resources/js/admin/mobile/hooks/useBackNavigation.test.tsx).
This commit is contained in:
@@ -32,6 +32,8 @@ import {
|
||||
} from './invite-layout/export-utils';
|
||||
import { LayoutElement, CANVAS_WIDTH, CANVAS_HEIGHT } from './invite-layout/schema';
|
||||
import { buildInitialTextFields } from './qr/utils';
|
||||
import { adminPath } from '../constants';
|
||||
import { useBackNavigation } from './hooks/useBackNavigation';
|
||||
|
||||
type Step = 'background' | 'text' | 'preview';
|
||||
|
||||
@@ -69,6 +71,7 @@ export default function MobileQrLayoutCustomizePage() {
|
||||
const [loading, setLoading] = React.useState(true);
|
||||
const [error, setError] = React.useState<string | null>(null);
|
||||
const { fonts: tenantFonts } = useTenantFonts();
|
||||
const back = useBackNavigation(slug ? adminPath(`/mobile/events/${slug}/qr`) : adminPath('/mobile/events'));
|
||||
|
||||
const handleSelectPreset = React.useCallback((id: string | null) => {
|
||||
setBackgroundPreset(id);
|
||||
@@ -181,7 +184,7 @@ export default function MobileQrLayoutCustomizePage() {
|
||||
<MobileShell
|
||||
activeTab="home"
|
||||
title={t('events.qr.customize', 'Layout anpassen')}
|
||||
onBack={() => navigate(-1)}
|
||||
onBack={back}
|
||||
headerActions={
|
||||
<HeaderActionButton onPress={() => window.location.reload()} ariaLabel={t('common.refresh', 'Refresh')}>
|
||||
<RefreshCcw size={18} color="#0f172a" />
|
||||
@@ -201,7 +204,7 @@ export default function MobileQrLayoutCustomizePage() {
|
||||
<MobileCard space="$2" marginTop="$2">
|
||||
{step === 'background' && (
|
||||
<BackgroundStep
|
||||
onBack={() => navigate(-1)}
|
||||
onBack={back}
|
||||
presets={BACKGROUND_PRESETS}
|
||||
selectedPreset={backgroundPreset}
|
||||
onSelectPreset={handleSelectPreset}
|
||||
|
||||
Reference in New Issue
Block a user