feat(mobile): implement event switcher sheet in header
- Replaced direct navigation with a bottom sheet for event switching - Created reusable EventSwitcherSheet component - Preserves context when switching events
This commit is contained in:
@@ -21,6 +21,7 @@ import { loadPhotoQueue } from '../lib/photoModerationQueue';
|
||||
import { countQueuedPhotoActions } from '../lib/queueStatus';
|
||||
import { useAdminTheme } from '../theme';
|
||||
import { useAuth } from '../../auth/context';
|
||||
import { EventSwitcherSheet } from './EventSwitcherSheet';
|
||||
|
||||
type MobileShellProps = {
|
||||
title?: string;
|
||||
@@ -55,6 +56,7 @@ export function MobileShell({ title, subtitle, children, activeTab, onBack, head
|
||||
const [loadingEvents, setLoadingEvents] = React.useState(false);
|
||||
const [attemptedFetch, setAttemptedFetch] = React.useState(false);
|
||||
const [queuedPhotoCount, setQueuedPhotoCount] = React.useState(0);
|
||||
const [switcherOpen, setSwitcherOpen] = React.useState(false);
|
||||
|
||||
const effectiveEvents = events.length ? events : fallbackEvents;
|
||||
const effectiveActive = activeEvent ?? (effectiveEvents.length === 1 ? effectiveEvents[0] : null);
|
||||
@@ -136,7 +138,7 @@ export function MobileShell({ title, subtitle, children, activeTab, onBack, head
|
||||
}
|
||||
|
||||
return (
|
||||
<Pressable onPress={() => navigate(ADMIN_EVENTS_PATH)}>
|
||||
<Pressable onPress={() => setSwitcherOpen(true)}>
|
||||
<XStack
|
||||
backgroundColor="rgba(255, 255, 255, 0.12)"
|
||||
paddingHorizontal="$3"
|
||||
@@ -334,6 +336,13 @@ export function MobileShell({ title, subtitle, children, activeTab, onBack, head
|
||||
</YStack>
|
||||
|
||||
<BottomNav active={activeTab} onNavigate={go} />
|
||||
|
||||
<EventSwitcherSheet
|
||||
open={switcherOpen}
|
||||
onClose={() => setSwitcherOpen(false)}
|
||||
events={effectiveEvents}
|
||||
activeSlug={effectiveActive?.slug ?? null}
|
||||
/>
|
||||
</YStack>
|
||||
);
|
||||
}
|
||||
@@ -364,4 +373,4 @@ export function HeaderActionButton({
|
||||
{children}
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user