Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

feat(mobile): journey create and entry sheets in the common sheet style

Maurice45361c276c2b
diff --git a/client/scripts/theme-baseline.json b/client/scripts/theme-baseline.json
index f9fd547b0..a832a9ea6 100644
--- a/client/scripts/theme-baseline.json
+++ b/client/scripts/theme-baseline.json
@@ -187,9 +187,9 @@
"mobile/screens/dashboard/MNewTripSheet.tsx": 12,
"mobile/screens/dashboard/MUserMenu.tsx": 7,
"mobile/screens/journey/MJourney.tsx": 10,
- "mobile/screens/journey/MJourneyCreateSheet.tsx": 10,
+ "mobile/screens/journey/MJourneyCreateSheet.tsx": 7,
"mobile/screens/journey/MJourneyDetail.tsx": 6,
- "mobile/screens/journey/MJourneyEntrySheet.tsx": 52,
+ "mobile/screens/journey/MJourneyEntrySheet.tsx": 48,
"mobile/screens/journey/MJourneySettingsSheet.tsx": 2,
"mobile/screens/journey/mobileJourneyMeta.ts": 4,
"mobile/screens/notifications/MNotificationRow.tsx": 4,
diff --git a/client/src/mobile/screens/collections/MCollShareSheet.tsx b/client/src/mobile/screens/collections/MCollShareSheet.tsx
index ed526112d..248210f5c 100644
--- a/client/src/mobile/screens/collections/MCollShareSheet.tsx
+++ b/client/src/mobile/screens/collections/MCollShareSheet.tsx
@@ -141,7 +141,7 @@ export default function MCollShareSheet({
onClick={handleInvite}
disabled={selectedUserId == null || inviting}
aria-label={t('collections.share.sendInvite')}
- className="flex w-11 flex-none items-center justify-center rounded-[12px] bg-m-act text-m-actfg disabled:opacity-40"
+ className="flex h-[42px] w-[42px] flex-none items-center justify-center self-center rounded-full bg-m-act text-m-actfg disabled:opacity-40"
>
{inviting ? <Loader2 size={16} className="animate-spin" /> : <UserPlus size={16} strokeWidth={2.2} />}
</button>
diff --git a/client/src/mobile/screens/journey/MJourneyCreateSheet.tsx b/client/src/mobile/screens/journey/MJourneyCreateSheet.tsx
index f2204d113..2de42cff8 100644
--- a/client/src/mobile/screens/journey/MJourneyCreateSheet.tsx
+++ b/client/src/mobile/screens/journey/MJourneyCreateSheet.tsx
@@ -1,6 +1,6 @@
-import { Feather, Calendar, MapPin, Check, X } from 'lucide-react'
+import { Feather, Calendar, MapPin, Check, NotebookPen } from 'lucide-react'
import MSheet from '../../components/MSheet'
-import MIconBtn from '../../components/MIconBtn'
+import { SHEET_PRIMARY, SHEET_SECONDARY, TileHeader } from '../trip/sheets/MTripSheetUi'
import { useTranslation } from '../../../i18n'
import { pickGradient } from '../../../pages/journeyDetail/JourneyDetailPage.helpers'
@@ -38,24 +38,27 @@ export default function MJourneyCreateSheet({
const { t } = useTranslation()
return (
- <MSheet open={open} onClose={onClose} variant="card" material="opaque" ariaLabel={t('journey.frontpage.createJourney')}>
- <div className="flex flex-none items-center border-b border-[color:var(--m-rowbr)] px-[18px] pb-[10px] pt-4">
- <div className="flex-1 text-[1.0625rem] font-bold">{t('journey.frontpage.createJourney')}</div>
- <MIconBtn variant="neutral" size={34} onClick={onClose} ariaLabel={t('common.cancel')}>
- <X size={15} strokeWidth={2.2} />
- </MIconBtn>
+ <MSheet open={open} onClose={onClose} variant="card" material="glass" ariaLabel={t('journey.frontpage.createJourney')}>
+ <div className="flex-none px-[18px] pt-4">
+ <TileHeader
+ icon={<NotebookPen size={19} strokeWidth={1.8} />}
+ title={t('journey.frontpage.createJourney')}
+ onClose={onClose}
+ closeLabel={t('common.cancel')}
+ />
</div>
- <div className="min-h-0 flex-1 overflow-y-auto px-[18px] py-3">
+ <div className="m-scroll-fade mt-2 min-h-0 flex-1 overflow-y-auto px-[18px] pb-[18px] pt-[14px]">
<div className="mb-[6px] font-geist text-[0.625rem] font-bold uppercase tracking-[.09em] text-m-faint">
{t('journey.frontpage.journeyName')}
</div>
- <div className="flex items-center gap-[10px] rounded-[14px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-[14px] py-3">
+ <div className="flex h-[42px] items-center gap-[10px] rounded-full border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-[14px]">
<Feather size={16} strokeWidth={2} className="flex-none text-m-muted" />
<input
value={title}
onChange={e => onTitleChange(e.target.value)}
placeholder={t('journey.frontpage.namePlaceholder')}
+ aria-label={t('journey.frontpage.journeyName')}
className="min-w-0 flex-1 bg-transparent text-[0.875rem] font-semibold text-m-ink outline-none placeholder:text-m-faint"
/>
</div>
@@ -120,19 +123,10 @@ export default function MJourneyCreateSheet({
</div>
<div className="flex flex-none items-center gap-2 border-t border-[color:var(--m-rowbr)] px-[18px] pb-4 pt-3">
- <button
- type="button"
- onClick={onClose}
- className="ms-auto rounded-full border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-4 py-[9px] text-[0.78125rem] font-semibold"
- >
+ <button type="button" onClick={onClose} className={`${SHEET_SECONDARY} ms-auto`}>
{t('common.cancel')}
</button>
- <button
- type="button"
- onClick={onCreate}
- disabled={!title.trim()}
- className="flex-1 rounded-full bg-m-act px-[18px] py-[9px] text-center text-[0.78125rem] font-semibold text-m-actfg disabled:opacity-40"
- >
+ <button type="button" onClick={onCreate} disabled={!title.trim()} className={SHEET_PRIMARY}>
{t('journey.create')}
</button>
</div>
diff --git a/client/src/mobile/screens/journey/MJourneyEntrySheet.tsx b/client/src/mobile/screens/journey/MJourneyEntrySheet.tsx
index 8c9b9e84d..f0b3b43ce 100644
--- a/client/src/mobile/screens/journey/MJourneyEntrySheet.tsx
+++ b/client/src/mobile/screens/journey/MJourneyEntrySheet.tsx
@@ -1,8 +1,9 @@
import { useRef, useState, type CSSProperties } from 'react'
-import { Briefcase, Camera, Plus, Image, Images, X, MapPin, Locate, Trash2, CheckCircle2, MinusCircle, ChevronUp, ChevronDown, EyeOff, Play } from 'lucide-react'
+import { Briefcase, Camera, Plus, Image, Images, X, MapPin, Locate, Trash2, CheckCircle2, MinusCircle, ChevronUp, ChevronDown, EyeOff, Play, NotebookPen } from 'lucide-react'
import MSheet from '../../components/MSheet'
import MIconBtn from '../../components/MIconBtn'
import MToggle from '../../components/MToggle'
+import { SHEET_PRIMARY, SHEET_SECONDARY } from '../trip/sheets/MTripSheetUi'
import { useTranslation } from '../../../i18n'
import CustomTimePicker from '../../../components/shared/CustomTimePicker'
import { CustomDatePicker } from '../../../components/shared/CustomDateTimePicker'
@@ -124,11 +125,15 @@ export default function MJourneyEntrySheet({
open
onClose={handleClose}
variant="card"
- material="opaque"
+ material="glass"
ariaLabel={entry.id === 0 ? t('journey.detail.newEntry') : t('journey.detail.editEntry')}
>
- <div className="flex flex-none items-center border-b border-[color:var(--m-rowbr)] px-[18px] pb-[10px] pt-4">
- <span className="flex-1 text-[1.0625rem] font-bold">
+ {/* TileHeader's shape, with the move buttons between the title and the close. */}
+ <div className="flex flex-none items-center gap-3 px-[18px] pb-1 pt-4">
+ <span className="flex h-10 w-10 flex-none items-center justify-center rounded-[13px] bg-[color:var(--m-ic)] text-m-ink">
+ <NotebookPen size={19} strokeWidth={1.8} />
+ </span>
+ <span className="min-w-0 flex-1 truncate text-[1.0625rem] font-bold leading-tight">
{entry.id === 0 ? t('journey.detail.newEntry') : t('journey.detail.editEntry')}
</span>
{(onMoveEarlier || onMoveLater) && (
@@ -146,7 +151,7 @@ export default function MJourneyEntrySheet({
</MIconBtn>
</div>
- <div className="min-h-0 flex-1 overflow-y-auto px-[18px] py-3">
+ <div className="m-scroll-fade mt-2 min-h-0 flex-1 overflow-y-auto px-[18px] pb-[18px] pt-[14px]">
{/* Quick capture had no title field at all: it asked for a note and nothing
else, so every entry caught on the move arrived nameless and the day's
list read as a column of identical placeholders (discussion #2299). The
@@ -713,17 +718,17 @@ export default function MJourneyEntrySheet({
<button
type="button"
onClick={onDelete}
- className="flex items-center gap-[5px] text-[0.75rem] font-bold text-[color:var(--m-st-danger)]"
+ aria-label={t('common.delete')}
+ className="flex h-[42px] w-[42px] flex-none items-center justify-center rounded-full border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] text-[color:var(--m-st-danger)]"
>
- <Trash2 size={13} strokeWidth={2} />
- {t('common.delete')}
+ <Trash2 size={15} strokeWidth={2} />
</button>
)}
{!readOnly && captureOnly && (
<button
type="button"
onClick={() => setCaptureOnly(false)}
- className="whitespace-nowrap rounded-full border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-4 py-[9px] text-[0.78125rem] font-semibold"
+ className={`${SHEET_SECONDARY} whitespace-nowrap`}
>
{t('journey.editor.addDetails')}
</button>
@@ -731,7 +736,7 @@ export default function MJourneyEntrySheet({
<button
type="button"
onClick={handleClose}
- className="ms-auto rounded-full border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-4 py-[9px] text-[0.78125rem] font-semibold"
+ className={`${SHEET_SECONDARY} ms-auto`}
>
{t('common.cancel')}
</button>
@@ -740,7 +745,7 @@ export default function MJourneyEntrySheet({
type="button"
onClick={handleSave}
disabled={saving}
- className="rounded-full bg-m-act px-[18px] py-[9px] text-[0.78125rem] font-semibold text-m-actfg disabled:opacity-50"
+ className={SHEET_PRIMARY}
>
{saving ? t('common.saving') : t('common.save')}
</button>