weiterer fortschritt mit tamagui und dem neuen mobile event admin
This commit is contained in:
@@ -4,14 +4,12 @@ import { useTranslation } from 'react-i18next';
|
||||
import { CalendarDays, ChevronDown, MapPin } from 'lucide-react';
|
||||
import { YStack, XStack } from '@tamagui/stacks';
|
||||
import { SizableText as Text } from '@tamagui/text';
|
||||
import { MobileScaffold } from './components/Scaffold';
|
||||
import { MobileShell } from './components/MobileShell';
|
||||
import { MobileCard, CTAButton } from './components/Primitives';
|
||||
import { BottomNav } from './components/BottomNav';
|
||||
import { createEvent, getEvent, updateEvent, TenantEvent } from '../api';
|
||||
import { adminPath } from '../constants';
|
||||
import { isAuthError } from '../auth/tokens';
|
||||
import { getApiErrorMessage } from '../lib/apiError';
|
||||
import { useMobileNav } from './hooks/useMobileNav';
|
||||
|
||||
type FormState = {
|
||||
name: string;
|
||||
@@ -42,7 +40,6 @@ export default function MobileEventFormPage() {
|
||||
const [loading, setLoading] = React.useState(isEdit);
|
||||
const [saving, setSaving] = React.useState(false);
|
||||
const [error, setError] = React.useState<string | null>(null);
|
||||
const { go } = useMobileNav(slug);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!slug) return;
|
||||
@@ -102,12 +99,10 @@ export default function MobileEventFormPage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<MobileScaffold
|
||||
<MobileShell
|
||||
activeTab="home"
|
||||
title={isEdit ? t('events.form.editTitle', 'Edit Event') : t('events.form.createTitle', 'Create New Event')}
|
||||
onBack={() => navigate(-1)}
|
||||
footer={
|
||||
<BottomNav active="home" onNavigate={go} />
|
||||
}
|
||||
>
|
||||
{error ? (
|
||||
<MobileCard>
|
||||
@@ -222,7 +217,7 @@ export default function MobileEventFormPage() {
|
||||
) : null}
|
||||
<CTAButton label={saving ? t('events.form.saving', 'Saving...') : isEdit ? t('events.form.update', 'Update Event') : t('events.form.create', 'Create Event')} onPress={() => handleSubmit()} />
|
||||
</YStack>
|
||||
</MobileScaffold>
|
||||
</MobileShell>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user