mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 02:14:05 +00:00
feat(mobile): phone styling for tours list, trip settings and admin cards
The tours list in the places browser now uses the same rows as places: a grade or type tile, the day plan's figure badges and a day badge or plus on the right. A shared "Planned on desktop" badge replaces the grey hint box there and sits under the road trip's empty stage. Trip settings and trip edit open phone sheets instead of the desktop dialogs; the edit sheet gains the day count of a dateless trip and the reminder. Questions are asked in phone sheets, not the browser. Admin on the phone: the paddle regions and school holiday cards are phone cards on their shared hooks, long addon descriptions fold to two lines, the addon header keeps the wordmark inside its sentence, the group bands drop the dash and the permissions actions get a row of their own. The Tours addon gets its catalog name and description in every locale. The journey map on the phone shows every layer without the switch bar.
This commit is contained in:
@@ -50,6 +50,12 @@ interface Options {
|
||||
colorOfDay: (date: string) => string | null;
|
||||
/** The day an entry is on, for the colour of its stays. */
|
||||
dateOfEntry: (entryId: number) => string | null;
|
||||
/**
|
||||
* Every layer on, whatever this browser kept: the phone shows no switches,
|
||||
* so a layer once switched off there would stay off with no way back. A
|
||||
* switch that is still offered then holds only for the visit.
|
||||
*/
|
||||
allLayers?: boolean;
|
||||
}
|
||||
|
||||
const NO_TRACKS: JourneyTrack[] = [];
|
||||
@@ -119,13 +125,14 @@ export function useJourneyMapLayers({
|
||||
recordedRead = 'ready',
|
||||
colorOfDay,
|
||||
dateOfEntry,
|
||||
allLayers = false,
|
||||
}: Options): JourneyMapLayersView {
|
||||
const { t, locale } = useTranslation();
|
||||
const journeyId = source && 'journeyId' in source ? source.journeyId : null;
|
||||
const token = source && 'token' in source ? source.token : null;
|
||||
const storageKey =
|
||||
journeyId !== null ? layersStorageKey({ journeyId }) : token !== null ? layersStorageKey({ token }) : null;
|
||||
const { visibility, toggle } = useLayerSwitches(storageKey);
|
||||
const { visibility, toggle } = useLayerSwitches(allLayers ? null : storageKey);
|
||||
|
||||
const sourceKey = journeyId !== null ? `j:${journeyId}` : token !== null ? `s:${token}` : null;
|
||||
// A shared page reads once; a journey's own map only while the plan or the entries are shown.
|
||||
|
||||
Reference in New Issue
Block a user