weitere perfektionierung der neuen mobile app
This commit is contained in:
@@ -9,11 +9,17 @@ import { MobileCard, CTAButton } from './components/Primitives';
|
||||
import { useEventContext } from '../context/EventContext';
|
||||
import { formatEventDate, resolveEventDisplayName } from '../lib/events';
|
||||
import { adminPath } from '../constants';
|
||||
import { useTheme } from '@tamagui/core';
|
||||
|
||||
export default function MobileUploadsTabPage() {
|
||||
const { events, activeEvent, hasEvents, selectEvent } = useEventContext();
|
||||
const { t, i18n } = useTranslation('management');
|
||||
const navigate = useNavigate();
|
||||
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 primary = String(theme.primary?.val ?? '#007AFF');
|
||||
|
||||
if (activeEvent?.slug) {
|
||||
return <Navigate to={adminPath(`/mobile/events/${activeEvent.slug}/photos`)} replace />;
|
||||
@@ -21,16 +27,16 @@ export default function MobileUploadsTabPage() {
|
||||
|
||||
if (!hasEvents) {
|
||||
return (
|
||||
<MobileShell activeTab="uploads" title={t('events.photos.title', 'Uploads')}>
|
||||
<MobileShell activeTab="uploads" title={t('mobileUploads.title', 'Uploads')}>
|
||||
<MobileCard alignItems="flex-start" space="$3">
|
||||
<Text fontSize="$lg" fontWeight="800" color="#111827">
|
||||
{t('events.photos.emptyTitle', 'Create an event first')}
|
||||
<Text fontSize="$lg" fontWeight="800" color={text}>
|
||||
{t('mobileUploads.emptyTitle', 'Create an event first')}
|
||||
</Text>
|
||||
<Text fontSize="$sm" color="#4b5563">
|
||||
{t('events.photos.emptyBody', 'Add your first event to review uploads and manage QR sharing.')}
|
||||
<Text fontSize="$sm" color={muted}>
|
||||
{t('mobileUploads.emptyBody', 'Add your first event to review uploads and manage QR sharing.')}
|
||||
</Text>
|
||||
<CTAButton
|
||||
label={t('events.actions.create', 'Create Event')}
|
||||
label={t('mobileDashboard.ctaCreate', 'Create event')}
|
||||
onPress={() => navigate(adminPath('/mobile/events/new'))}
|
||||
/>
|
||||
</MobileCard>
|
||||
@@ -41,10 +47,10 @@ export default function MobileUploadsTabPage() {
|
||||
const locale = i18n.language?.startsWith('en') ? 'en-GB' : 'de-DE';
|
||||
|
||||
return (
|
||||
<MobileShell activeTab="uploads" title={t('events.photos.title', 'Uploads')}>
|
||||
<MobileShell activeTab="uploads" title={t('mobileUploads.title', 'Uploads')}>
|
||||
<YStack space="$2">
|
||||
<Text fontSize="$sm" color="#111827" fontWeight="700">
|
||||
{t('events.photos.pickEvent', 'Pick an event to manage uploads')}
|
||||
<Text fontSize="$sm" color={text} fontWeight="700">
|
||||
{t('mobileUploads.pickEvent', 'Pick an event to manage uploads')}
|
||||
</Text>
|
||||
{events.map((event) => (
|
||||
<Pressable
|
||||
@@ -56,21 +62,21 @@ export default function MobileUploadsTabPage() {
|
||||
}
|
||||
}}
|
||||
>
|
||||
<MobileCard borderColor="#e5e7eb" space="$2">
|
||||
<MobileCard borderColor={border} space="$2">
|
||||
<XStack alignItems="center" justifyContent="space-between">
|
||||
<YStack space="$1">
|
||||
<Text fontSize="$md" fontWeight="800" color="#111827">
|
||||
{resolveEventDisplayName(event)}
|
||||
</Text>
|
||||
<Text fontSize="$xs" color="#6b7280">
|
||||
{formatEventDate(event.event_date, locale) ?? t('events.status.draft', 'Draft')}
|
||||
</Text>
|
||||
</YStack>
|
||||
<Text fontSize="$sm" color="#007AFF" fontWeight="700">
|
||||
{t('events.actions.open', 'Open')}
|
||||
<Text fontSize="$md" fontWeight="800" color={text}>
|
||||
{resolveEventDisplayName(event)}
|
||||
</Text>
|
||||
</XStack>
|
||||
</MobileCard>
|
||||
<Text fontSize="$xs" color={muted}>
|
||||
{formatEventDate(event.event_date, locale) ?? t('mobileDashboard.status.draft', 'Draft')}
|
||||
</Text>
|
||||
</YStack>
|
||||
<Text fontSize="$sm" color={primary} fontWeight="700">
|
||||
{t('mobileUploads.open', 'Open')}
|
||||
</Text>
|
||||
</XStack>
|
||||
</MobileCard>
|
||||
</Pressable>
|
||||
))}
|
||||
</YStack>
|
||||
|
||||
Reference in New Issue
Block a user