From a3e2ff9fa5bcfc01ee885e77e5500acf92cb13e9 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 25 Jul 2026 17:07:02 +0200 Subject: [PATCH] fix(mobile): offer the currency on the dashboard trip sheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mobile create/edit sheet never showed the currency, so every trip started from the dashboard silently took the server default of EUR and could only be corrected from the trip planner, which reuses TripFormModal and does have the field. Same control as the desktop form — searchable select over currenciesWith(), gated on trip_edit like the rest of the sheet. --- .../mobile/screens/dashboard/MNewTripSheet.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/client/src/mobile/screens/dashboard/MNewTripSheet.tsx b/client/src/mobile/screens/dashboard/MNewTripSheet.tsx index 6ad544620..6908d7c9a 100644 --- a/client/src/mobile/screens/dashboard/MNewTripSheet.tsx +++ b/client/src/mobile/screens/dashboard/MNewTripSheet.tsx @@ -7,6 +7,8 @@ import { useToast } from '../../../components/shared/Toast' import { normalizeImageFile } from '../../../utils/convertHeic' import { getApiErrorMessage } from '../../../types' import { CustomDatePicker } from '../../../components/shared/CustomDateTimePicker' +import CustomSelect from '../../../components/shared/CustomSelect' +import { currenciesWith, SYMBOLS } from '../../../components/Budget/BudgetPanel.constants' import type { DashboardTrip } from '../../../pages/dashboard/dashboardModel' import type { Trip, TripCreateRequest } from '@trek/shared' import MSheet from '../../components/MSheet' @@ -57,6 +59,7 @@ export default function MNewTripSheet({ open, trip, onClose, onSave, onCoverUpda const [description, setDescription] = useState('') const [startDate, setStartDate] = useState('') const [endDate, setEndDate] = useState('') + const [currency, setCurrency] = useState('EUR') const [error, setError] = useState('') const [isSaving, setIsSaving] = useState(false) const [coverPreview, setCoverPreview] = useState(null) @@ -74,6 +77,7 @@ export default function MNewTripSheet({ open, trip, onClose, onSave, onCoverUpda setDescription(trip?.description || '') setStartDate(trip?.start_date || '') setEndDate(trip?.end_date || '') + setCurrency(trip?.currency || 'EUR') setCoverPreview(trip?.cover_image || null) setPendingCoverFile(null) setPendingUnsplashUrl(null) @@ -109,6 +113,7 @@ export default function MNewTripSheet({ open, trip, onClose, onSave, onCoverUpda description: description.trim() || null, start_date: startDate || null, end_date: endDate || null, + currency, ...(!startDate && !endDate && !isEditing ? { day_count: 7 } : {}), }) const created = result ? result.trip : undefined @@ -290,6 +295,19 @@ export default function MNewTripSheet({ open, trip, onClose, onSave, onCoverUpda
{t('dashboard.noDateHint')}
)} +
+ {t('dashboard.currency')} + { if (canEditTrip) setCurrency(String(v)) }} + disabled={!canEditTrip} + searchable + size="sm" + options={currenciesWith(currency).map(c => ({ value: c, label: `${c} (${SYMBOLS[c] || c})` }))} + style={{ width: '100%', marginTop: 5 }} + /> +
+ {canUploadCover && (