feat(admin-pwa): add floating action button to event form
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-18 11:33:09 +01:00
parent f1f552ad2d
commit 926bc7d070

View File

@@ -2,12 +2,12 @@ import React from 'react';
import { useNavigate, useParams } from 'react-router-dom'; import { useNavigate, useParams } from 'react-router-dom';
import { useQueryClient } from '@tanstack/react-query'; import { useQueryClient } from '@tanstack/react-query';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { CalendarDays, ChevronDown, MapPin } from 'lucide-react'; import { CalendarDays, ChevronDown, MapPin, Save, Check } from 'lucide-react';
import { YStack, XStack } from '@tamagui/stacks'; import { YStack, XStack } from '@tamagui/stacks';
import { SizableText as Text } from '@tamagui/text'; import { SizableText as Text } from '@tamagui/text';
import { Switch } from '@tamagui/switch'; import { Switch } from '@tamagui/switch';
import { MobileShell } from './components/MobileShell'; import { MobileShell } from './components/MobileShell';
import { MobileCard, CTAButton } from './components/Primitives'; import { MobileCard, CTAButton, FloatingActionButton } from './components/Primitives';
import { MobileDateTimeInput, MobileField, MobileInput, MobileSelect, MobileTextArea } from './components/FormControls'; import { MobileDateTimeInput, MobileField, MobileInput, MobileSelect, MobileTextArea } from './components/FormControls';
import { LegalConsentSheet } from './components/LegalConsentSheet'; import { LegalConsentSheet } from './components/LegalConsentSheet';
import { import {
@@ -559,7 +559,7 @@ export default function MobileEventFormPage() {
</MobileField> </MobileField>
</MobileCard> </MobileCard>
<YStack space="$2"> <YStack space="$2" paddingBottom="$10">
{!isEdit ? ( {!isEdit ? (
<CTAButton <CTAButton
label={t('eventForm.actions.saveDraft', 'Save as draft')} label={t('eventForm.actions.saveDraft', 'Save as draft')}
@@ -567,18 +567,20 @@ export default function MobileEventFormPage() {
onPress={back} onPress={back}
/> />
) : null} ) : null}
<CTAButton
label={
saving
? t('eventForm.actions.saving', 'Saving…')
: isEdit
? t('eventForm.actions.update', 'Update event')
: t('eventForm.actions.create', 'Create event')
}
onPress={() => handleSubmit()}
/>
</YStack> </YStack>
<FloatingActionButton
label={
saving
? t('eventForm.actions.saving', 'Saving…')
: isEdit
? t('eventForm.actions.update', 'Update event')
: t('eventForm.actions.create', 'Create event')
}
icon={isEdit ? Save : Check}
onPress={() => handleSubmit()}
/>
<LegalConsentSheet <LegalConsentSheet
open={consentOpen} open={consentOpen}
onClose={() => { onClose={() => {