mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 03:50:30 +00:00
feat(mobile): remaining sheets get the common header
Atlas bucket list, open route in, open in TREK, the place actions and the MCP/OAuth client sheets now show the icon tile header (or, where a sheet closes only by its buttons, the same title row without the close).
This commit is contained in:
@@ -166,7 +166,7 @@
|
||||
"mobile/screens/admin/MAdminUsersSection.tsx": 14,
|
||||
"mobile/screens/admin/MApiProviderBlocks.tsx": 10,
|
||||
"mobile/screens/atlas/MAtlas.tsx": 5,
|
||||
"mobile/screens/atlas/MAtlasBucketSheet.tsx": 16,
|
||||
"mobile/screens/atlas/MAtlasBucketSheet.tsx": 14,
|
||||
"mobile/screens/atlas/MAtlasCountryPopup.tsx": 11,
|
||||
"mobile/screens/atlas/MAtlasSearch.tsx": 5,
|
||||
"mobile/screens/atlas/MAtlasStatsCard.tsx": 3,
|
||||
@@ -207,7 +207,7 @@
|
||||
"mobile/screens/settings/MSettingsAccount.tsx": 20,
|
||||
"mobile/screens/settings/MSettingsAppearance.tsx": 12,
|
||||
"mobile/screens/settings/MSettingsMap.tsx": 5,
|
||||
"mobile/screens/settings/MSettingsMcp.tsx": 30,
|
||||
"mobile/screens/settings/MSettingsMcp.tsx": 26,
|
||||
"mobile/screens/settings/MSettingsNotifications.tsx": 5,
|
||||
"mobile/screens/settings/MSettingsOffline.tsx": 18,
|
||||
"mobile/screens/settings/MSettingsPlugins.tsx": 14,
|
||||
@@ -236,7 +236,7 @@
|
||||
"mobile/screens/trip/sheets/ImpListStep.tsx": 3,
|
||||
"mobile/screens/trip/sheets/MAccommodationSheet.tsx": 10,
|
||||
"mobile/screens/trip/sheets/MBookingFields.tsx": 5,
|
||||
"mobile/screens/trip/sheets/MBrowseActionsSheet.tsx": 5,
|
||||
"mobile/screens/trip/sheets/MBrowseActionsSheet.tsx": 3,
|
||||
"mobile/screens/trip/sheets/MCostSheet.tsx": 33,
|
||||
"mobile/screens/trip/sheets/MDaySheet.tsx": 22,
|
||||
"mobile/screens/trip/sheets/MDaysSheet.tsx": 4,
|
||||
|
||||
@@ -10,6 +10,7 @@ import { tripsApi } from '../../api/client';
|
||||
import { useTranslation } from '../../i18n';
|
||||
import MSheet from '../../mobile/components/MSheet';
|
||||
import { useSharedImportStore } from '../../native/sharedFiles';
|
||||
import { TileHeader } from '../../mobile/screens/trip/sheets/MTripSheetUi'
|
||||
|
||||
interface TripRow {
|
||||
id: number;
|
||||
@@ -52,16 +53,16 @@ export default function NativeImportSheet(): React.ReactElement | null {
|
||||
|
||||
return (
|
||||
<MSheet open={open} onClose={() => setFile(null)} variant="bottom" ariaLabel={t('native.share.title')}>
|
||||
<div className="px-4 pb-4 pt-6">
|
||||
<div className="mb-1 px-1 text-[length:calc(13px*var(--fs-scale-body,1))] font-bold text-m-ink">
|
||||
{t('native.share.title')}
|
||||
<div className="px-[18px] pb-4 pt-4">
|
||||
<div className="mb-3">
|
||||
<TileHeader
|
||||
icon={<FileText size={19} strokeWidth={1.8} />}
|
||||
title={t('native.share.title')}
|
||||
sub={file?.name}
|
||||
onClose={() => setFile(null)}
|
||||
closeLabel={t('common.close')}
|
||||
/>
|
||||
</div>
|
||||
{file && (
|
||||
<div className="mb-3 flex items-center gap-2 px-1 font-geist text-[length:calc(11px*var(--fs-scale-body,1))] text-m-muted">
|
||||
<FileText size={13} aria-hidden="true" />
|
||||
<span className="truncate">{file.name}</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex max-h-[50vh] flex-col gap-2 overflow-y-auto">
|
||||
{trips.map((trip) => (
|
||||
<button
|
||||
|
||||
@@ -6,6 +6,7 @@ import { A2_TO_A3 } from '../../../pages/atlas/atlasModel'
|
||||
import type { BucketItem } from '../../../pages/atlas/atlasModel'
|
||||
import type { AtlasController } from './atlasController'
|
||||
import { getIntlLanguage } from '@trek/shared'
|
||||
import { TileHeader } from '../trip/sheets/MTripSheetUi'
|
||||
|
||||
interface MAtlasBucketSheetProps {
|
||||
atlas: AtlasController
|
||||
@@ -87,18 +88,15 @@ export default function MAtlasBucketSheet({ atlas, open, onClose }: MAtlasBucket
|
||||
|
||||
return (
|
||||
<MSheet open={open} onClose={close} variant="bottom" material="glass" ariaLabel={t('atlas.bucketTab')}>
|
||||
<div className="flex min-h-0 flex-col p-4">
|
||||
<div className="flex items-center gap-[10px] px-1 pb-3">
|
||||
<Star size={17} strokeWidth={2.2} className="flex-none text-[color:var(--m-st-pending)]" />
|
||||
<div className="min-w-0 flex-1 truncate text-[0.9375rem] font-extrabold text-m-ink">
|
||||
{t('atlas.bucketTab')}
|
||||
{bucketList.length > 0 && (
|
||||
<span className="ms-[6px] font-geist text-[0.75rem] font-semibold tabular-nums text-m-faint">{bucketList.length}</span>
|
||||
)}
|
||||
</div>
|
||||
<MIconBtn variant="neutral" size={34} onClick={close} ariaLabel={t('common.close')}>
|
||||
<X size={16} strokeWidth={2.2} />
|
||||
</MIconBtn>
|
||||
<div className="flex min-h-0 flex-col px-[18px] pb-4 pt-4">
|
||||
<div className="mb-3">
|
||||
<TileHeader
|
||||
icon={<Star size={19} strokeWidth={1.8} className="text-[color:var(--m-st-pending)]" />}
|
||||
title={t('atlas.bucketTab')}
|
||||
sub={bucketList.length > 0 ? String(bucketList.length) : undefined}
|
||||
onClose={close}
|
||||
closeLabel={t('common.close')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="min-h-0 flex-1 space-y-2 overflow-y-auto">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Check, ChevronDown, ChevronRight, Copy, KeyRound, Plus, RefreshCw, Terminal, Trash2 } from 'lucide-react'
|
||||
import type { ReactNode } from 'react'
|
||||
import { Check, ChevronDown, ChevronRight, Copy, KeyRound, Plus, RefreshCw, Terminal, Trash2, Key, CircleCheck, RotateCcw } from 'lucide-react'
|
||||
import { useTranslation } from '../../../i18n'
|
||||
import { useFormatDate } from '../../../hooks/useDateFormat'
|
||||
import { OAUTH_PRESETS, useMcpIntegration } from '../../../components/Settings/useMcpIntegration'
|
||||
@@ -306,7 +307,7 @@ export default function MSettingsMcp() {
|
||||
<div className="min-h-0 overflow-y-auto p-[18px]">
|
||||
{!createdClient ? (
|
||||
<>
|
||||
<div className="text-[0.9375rem] font-extrabold text-m-ink">{t('settings.oauth.modal.createTitle')}</div>
|
||||
<SheetTitle icon={<KeyRound size={19} strokeWidth={1.8} />}>{t('settings.oauth.modal.createTitle')}</SheetTitle>
|
||||
|
||||
<MSetEyebrow className="mb-[6px] mt-3">{t('settings.oauth.modal.presets')}</MSetEyebrow>
|
||||
<div className="flex flex-wrap gap-[6px]">
|
||||
@@ -361,7 +362,7 @@ export default function MSettingsMcp() {
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<div className="text-[0.9375rem] font-extrabold text-m-ink">{t('settings.oauth.modal.createdTitle')}</div>
|
||||
<SheetTitle icon={<CircleCheck size={19} strokeWidth={1.8} />}>{t('settings.oauth.modal.createdTitle')}</SheetTitle>
|
||||
<p className="mt-2 rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] p-3 font-geist text-[0.625rem] leading-relaxed text-[color:var(--m-st-pending)]">
|
||||
{t('settings.oauth.modal.createdWarning')}
|
||||
</p>
|
||||
@@ -415,7 +416,7 @@ export default function MSettingsMcp() {
|
||||
<div className="p-[18px]">
|
||||
{!createdToken ? (
|
||||
<>
|
||||
<div className="text-[0.9375rem] font-extrabold text-m-ink">{t('settings.mcp.modal.createTitle')}</div>
|
||||
<SheetTitle icon={<Key size={19} strokeWidth={1.8} />}>{t('settings.mcp.modal.createTitle')}</SheetTitle>
|
||||
<MSetEyebrow className="mb-[5px] mt-3">{t('settings.mcp.modal.tokenName')}</MSetEyebrow>
|
||||
<MSetInput
|
||||
autoFocus
|
||||
@@ -435,7 +436,7 @@ export default function MSettingsMcp() {
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<div className="text-[0.9375rem] font-extrabold text-m-ink">{t('settings.mcp.modal.createdTitle')}</div>
|
||||
<SheetTitle icon={<CircleCheck size={19} strokeWidth={1.8} />}>{t('settings.mcp.modal.createdTitle')}</SheetTitle>
|
||||
<p className="mt-2 rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] p-3 font-geist text-[0.625rem] leading-relaxed text-[color:var(--m-st-pending)]">
|
||||
{t('settings.mcp.modal.createdWarning')}
|
||||
</p>
|
||||
@@ -463,7 +464,7 @@ export default function MSettingsMcp() {
|
||||
{/* Rotated secret display */}
|
||||
<MSheet open={rotatedSecret !== null} onClose={() => setRotatedSecret(null)} variant="card" material="glass" ariaLabel={t('settings.oauth.rotateSecretDoneTitle')}>
|
||||
<div className="p-[18px]">
|
||||
<div className="text-[0.9375rem] font-extrabold text-m-ink">{t('settings.oauth.rotateSecretDoneTitle')}</div>
|
||||
<SheetTitle icon={<RotateCcw size={19} strokeWidth={1.8} />}>{t('settings.oauth.rotateSecretDoneTitle')}</SheetTitle>
|
||||
<p className="mt-2 rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] p-3 font-geist text-[0.625rem] leading-relaxed text-[color:var(--m-st-pending)]">
|
||||
{t('settings.oauth.rotateSecretDoneWarning')}
|
||||
</p>
|
||||
@@ -527,3 +528,13 @@ export default function MSettingsMcp() {
|
||||
</DemoLock>
|
||||
)
|
||||
}
|
||||
|
||||
/** The sheets' title row: the icon tile and the title, as TileHeader without the close (these close by their buttons). */
|
||||
function SheetTitle({ icon, children }: { icon: ReactNode; children: ReactNode }) {
|
||||
return (
|
||||
<div className="mb-1 flex items-center gap-3">
|
||||
<span className="flex h-10 w-10 flex-none items-center justify-center rounded-[13px] bg-[color:var(--m-ic)] text-m-ink">{icon}</span>
|
||||
<div className="min-w-0 flex-1 text-[1.0625rem] font-bold leading-tight text-m-ink">{children}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { ChevronRight, MapPinned } from 'lucide-react';
|
||||
import type { DayRouteTarget } from '../../../../components/Planner/dayRouteApps';
|
||||
import type { TranslationFn } from '../../../../types';
|
||||
import MSheet from '../../../components/MSheet';
|
||||
import { TileHeader } from '../sheets/MTripSheetUi'
|
||||
|
||||
/** Opens a target: a web link in a new tab (the app takes it over), geo: in place. */
|
||||
export function openRouteTarget(target: DayRouteTarget): void {
|
||||
@@ -27,10 +28,14 @@ export default function MRouteAppsSheet({
|
||||
}) {
|
||||
return (
|
||||
<MSheet open={open} onClose={onClose} variant="bottom" ariaLabel={t('mobileTrip.openRouteIn')}>
|
||||
<div className="px-4 pb-4 pt-6">
|
||||
<div className="mb-3 flex items-center gap-2 px-1 text-[length:calc(13px*var(--fs-scale-body,1))] font-bold text-m-ink">
|
||||
<MapPinned size={16} strokeWidth={2.2} className="text-m-muted" aria-hidden="true" />
|
||||
{t('mobileTrip.openRouteIn')}
|
||||
<div className="px-[18px] pb-4 pt-4">
|
||||
<div className="mb-3">
|
||||
<TileHeader
|
||||
icon={<MapPinned size={19} strokeWidth={1.8} />}
|
||||
title={t('mobileTrip.openRouteIn')}
|
||||
onClose={onClose}
|
||||
closeLabel={t('common.close')}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
{targets.map((target) => (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { Bookmark, Calendar, ChevronDown, ChevronUp, Eye, Pencil, Trash2 } from 'lucide-react'
|
||||
import { Bookmark, Calendar, ChevronDown, ChevronUp, Eye, Pencil, Trash2, MapPin } from 'lucide-react'
|
||||
import MSheet from '../../../components/MSheet'
|
||||
import type { MTripSheetsProps } from '../MTripShell'
|
||||
import { useTranslation } from '../../../../i18n'
|
||||
@@ -9,6 +9,7 @@ import { placeToSaveTarget } from '../../../../components/Collections/saveTarget
|
||||
import { useTourDayAssignment } from '../../../../components/Tours/useTourDayAssignment'
|
||||
import { stageKeysOfTour } from '../../../../components/Tours/stages/stageSpread'
|
||||
import type { Place } from '../../../../types'
|
||||
import { TileHeader } from './MTripSheetUi'
|
||||
|
||||
interface BrowseActionsPayload {
|
||||
placeId?: number
|
||||
@@ -82,16 +83,17 @@ export default function MBrowseActionsSheet({ planner, shell }: MTripSheetsProps
|
||||
|
||||
return (
|
||||
<MSheet open={open && !!livePlace} onClose={shell.closeSheet} variant="card" material="glass" ariaLabel={place.name}>
|
||||
<div className="flex-none border-b border-[color:var(--m-rowbr)] px-[18px] pb-[11px] pt-4">
|
||||
<div className="truncate text-[1.03125rem] font-bold">{place.name}</div>
|
||||
{(place.address || place.description) && (
|
||||
<div className="mt-[2px] truncate font-geist text-[0.6875rem] text-m-muted">
|
||||
{place.address || place.description}
|
||||
</div>
|
||||
)}
|
||||
<div className="flex-none px-[18px] pt-4">
|
||||
<TileHeader
|
||||
icon={<MapPin size={19} strokeWidth={1.8} />}
|
||||
title={place.name}
|
||||
sub={place.address || place.description || undefined}
|
||||
onClose={shell.closeSheet}
|
||||
closeLabel={t('common.close')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="min-h-0 flex-1 overflow-y-auto px-[10px] pb-3 pt-[6px]">
|
||||
<div className="m-scroll-fade mt-2 min-h-0 flex-1 overflow-y-auto px-[10px] pb-3 pt-[10px]">
|
||||
<button type="button" onClick={viewDetails} className={rowCls}>
|
||||
<Eye size={16} strokeWidth={2} className="flex-none text-m-muted" />
|
||||
{t('mobileTrip.viewDetails')}
|
||||
|
||||
Reference in New Issue
Block a user