weitere perfektionierung der neuen mobile app

This commit is contained in:
Codex Agent
2025-12-11 12:18:08 +01:00
parent 7b01a77083
commit b4417db5cd
38 changed files with 4265 additions and 3040 deletions

View File

@@ -4,23 +4,23 @@ import { useEventContext } from '../../context/EventContext';
import { listGuestNotifications } from '../../api';
/**
* Lightweight badge count for alerts tab.
* Badge count for notifications bell in the mobile shell.
* Fetches guest notifications for the active event and returns count.
*/
export function useAlertsBadge() {
export function useNotificationsBadge() {
const { activeEvent } = useEventContext();
const slug = activeEvent?.slug;
const { data: count = 0 } = useQuery<number>({
queryKey: ['mobile', 'alerts', 'badge', slug],
queryKey: ['mobile', 'notifications', 'badge', slug],
enabled: Boolean(slug),
staleTime: 60_000,
queryFn: async () => {
if (!slug) {
return 0;
}
const alerts = await listGuestNotifications(slug);
return Array.isArray(alerts) ? alerts.length : 0;
const notifications = await listGuestNotifications(slug);
return Array.isArray(notifications) ? notifications.length : 0;
},
});