neues Admin UI Layout eingeführt. Alle Tests auf den neusten Stand gebracht.

This commit is contained in:
Codex Agent
2025-12-30 10:24:06 +01:00
parent 902e78cae9
commit efe2f25b3e
85 changed files with 95235 additions and 19197 deletions

View File

@@ -15,13 +15,13 @@ import { getApiErrorMessage } from '../lib/apiError';
import toast from 'react-hot-toast';
import { MobileSheet } from './components/Sheet';
import { getEvents, TenantEvent } from '../api';
import { useTheme } from '@tamagui/core';
import { triggerHaptic } from './lib/haptics';
import { adminPath } from '../constants';
import { useBackNavigation } from './hooks/useBackNavigation';
import { groupNotificationsByScope, type NotificationScope, type NotificationGroup } from './lib/notificationGrouping';
import { collectUnreadIds } from './lib/notificationUnread';
import { formatRelativeTime } from './lib/relativeTime';
import { useAdminTheme } from './theme';
type NotificationItem = {
id: string;
@@ -44,13 +44,13 @@ type NotificationSwipeRowProps = {
function NotificationSwipeRow({ item, onOpen, onMarkRead, children }: NotificationSwipeRowProps) {
const { t } = useTranslation('management');
const theme = useTheme();
const { successBg, successText, infoBg, infoText } = useAdminTheme();
const controls = useAnimationControls();
const dragged = React.useRef(false);
const markBg = String(theme.green3?.val ?? '#dcfce7');
const markText = String(theme.green10?.val ?? '#166534');
const detailBg = String(theme.blue3?.val ?? '#dbeafe');
const detailText = String(theme.blue10?.val ?? '#1d4ed8');
const markBg = successBg;
const markText = successText;
const detailBg = infoBg;
const detailText = infoText;
const handleDrag = (_event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo) => {
dragged.current = Math.abs(info.offset.x) > 6;
@@ -326,16 +326,10 @@ export default function MobileNotificationsPage() {
const [events, setEvents] = React.useState<TenantEvent[]>([]);
const [showEventPicker, setShowEventPicker] = React.useState(false);
const back = useBackNavigation(adminPath('/mobile/dashboard'));
const theme = useTheme();
const text = String(theme.color?.val ?? '#111827');
const muted = String(theme.gray?.val ?? '#4b5563');
const border = String(theme.borderColor?.val ?? '#e5e7eb');
const warningBg = String(theme.yellow3?.val ?? '#fef3c7');
const warningIcon = String(theme.yellow11?.val ?? '#92400e');
const infoBg = String(theme.blue3?.val ?? '#e0f2fe');
const infoIcon = String(theme.primary?.val ?? '#2563eb');
const errorText = String(theme.red10?.val ?? '#b91c1c');
const primary = String(theme.primary?.val ?? '#007AFF');
const { text, muted, border, warningBg, warningText, infoBg, primary, danger, accentSoft, subtle } = useAdminTheme();
const warningIcon = warningText;
const infoIcon = primary;
const errorText = danger;
const reload = React.useCallback(async () => {
setLoading(true);
@@ -579,7 +573,7 @@ export default function MobileNotificationsPage() {
borderRadius={14}
borderWidth={1}
borderColor={active ? primary : border}
backgroundColor={active ? String(theme.blue3?.val ?? '#e0f2fe') : 'transparent'}
backgroundColor={active ? accentSoft : 'transparent'}
>
<Text fontSize="$xs" fontWeight="700" color={active ? primary : muted}>
{filter.label}
@@ -598,7 +592,7 @@ export default function MobileNotificationsPage() {
</YStack>
) : statusFiltered.length === 0 ? (
<MobileCard alignItems="center" justifyContent="center" space="$2">
<Bell size={24} color={String(theme.gray9?.val ?? '#9ca3af')} />
<Bell size={24} color={subtle} />
<Text fontSize="$sm" fontWeight="700" color={text}>
{t('mobileNotifications.emptyTitle', 'All caught up')}
</Text>