feat(admin-pwa): add floating action button to event form
This commit is contained in:
@@ -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,7 +567,9 @@ export default function MobileEventFormPage() {
|
|||||||
onPress={back}
|
onPress={back}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
<CTAButton
|
</YStack>
|
||||||
|
|
||||||
|
<FloatingActionButton
|
||||||
label={
|
label={
|
||||||
saving
|
saving
|
||||||
? t('eventForm.actions.saving', 'Saving…')
|
? t('eventForm.actions.saving', 'Saving…')
|
||||||
@@ -575,9 +577,9 @@ export default function MobileEventFormPage() {
|
|||||||
? t('eventForm.actions.update', 'Update event')
|
? t('eventForm.actions.update', 'Update event')
|
||||||
: t('eventForm.actions.create', 'Create event')
|
: t('eventForm.actions.create', 'Create event')
|
||||||
}
|
}
|
||||||
|
icon={isEdit ? Save : Check}
|
||||||
onPress={() => handleSubmit()}
|
onPress={() => handleSubmit()}
|
||||||
/>
|
/>
|
||||||
</YStack>
|
|
||||||
|
|
||||||
<LegalConsentSheet
|
<LegalConsentSheet
|
||||||
open={consentOpen}
|
open={consentOpen}
|
||||||
|
|||||||
Reference in New Issue
Block a user