diff --git a/client/src/components/Tours/TourDetailDialog.tsx b/client/src/components/Tours/TourDetailDialog.tsx index aa46f42f4..0b980647d 100644 --- a/client/src/components/Tours/TourDetailDialog.tsx +++ b/client/src/components/Tours/TourDetailDialog.tsx @@ -61,7 +61,7 @@ import { SkiHeadPill } from './ski/skiMarks'; import { tourDayRowIcon } from './tourDayRowIcon'; import { tourDaysOf } from './tourDays'; import { heightsUnknown, movingTimeLabel, withoutHeights } from './tourFacts'; -import { TourDayPills, TourFactFields, TourMetricFields, type TourMetricField } from './tourParts'; +import { TourDayTiles, TourFactFields, TourMetricFields, type TourMetricField } from './tourParts'; import { formatPlannedTourDuration, hikeSourceBadgeLabel, @@ -159,7 +159,13 @@ function TourDetailMeasures({ ) : ( <> - {timeFields.length > 0 && } + {/* The times fill the row: two share it, three take a third each. */} + {timeFields.length > 0 && ( + = 3 ? 3 : undefined} + /> + )} )} {analysis.distanceIndexedProfileSamples.length >= 2 && ( @@ -430,7 +436,7 @@ function TourNameHeading({ ); if (onUpdatePlace && editingName) { return ( -
+
@@ -453,9 +459,9 @@ function TourNameHeading({ onClick={() => void saveName()} disabled={savingName} aria-label={t('common.save')} - className="grid h-7 w-7 flex-none place-items-center rounded-full bg-accent text-accent-text disabled:opacity-50" + className="grid h-8 w-8 flex-none place-items-center rounded-full bg-accent text-accent-text shadow-sm disabled:opacity-50" > - +
@@ -710,9 +716,7 @@ export default function TourDetailDialog({ {tourDays.length > 0 ? ( -
- -
+ ) : (

{t('tours.days.none')} @@ -809,7 +813,7 @@ function SaveAsNewButton({ onSave }: { onSave: () => Promise | void }) { icon={saving ? : } aria-label={t('tours.copy.action')} > - {t('tours.copy.action')} + {t('common.copy')} diff --git a/client/src/components/Tours/tourParts.tsx b/client/src/components/Tours/tourParts.tsx index e0d1910fc..c181d137b 100644 --- a/client/src/components/Tours/tourParts.tsx +++ b/client/src/components/Tours/tourParts.tsx @@ -12,6 +12,7 @@ import { BOX, Eyebrow } from '../Planner/bookings/bookingParts' import { SoftPill, WhiteBadge } from '../Planner/planParts' import { hikeSourceBadgeLabel, tourSource } from './tourPresentation' import { type TourDay, dayMenuLabel } from './tourDays' +import { formatDate } from '../../utils/formatters' import { tourMetricFacts } from './tourFacts' import type { TourDayAssignment } from './useTourDayAssignment' import { useRailFold } from './railFold' @@ -181,6 +182,43 @@ export function TourDayPills({ ) } +/** + * The days a tour is on, as the detail shows them: one box per day in the look + * of the measures below, so the days and the numbers read as one block. The + * date sits under the day's number where the day has one; the tooltip names + * the day in full. + */ +export function TourDayTiles({ tourDays }: { tourDays: readonly TourDay[] }) { + const { t, locale } = useTranslation() + return ( +

+ {tourDays.map((tourDay) => { + const full = dayMenuLabel(tourDay.day, tourDay.index, t, locale) + const date = formatDate(tourDay.day.date, locale) + return ( + + + + + {t('dayplan.dayN', { n: tourDay.index + 1 })} + + {date && ( + + {date} + + )} + + + ) + })} +
+ ) +} + /** * Putting a tour on a day: a round "+" on a row, or a footer button with a * chevron, both opening the trip's days as a menu. Which days it offers and