mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 22:50:51 +00:00
feat(timeline): open on three months unless the URL names a zoom
This commit is contained in:
1 parent
b7eef0dff4
commit
8cd6cf3c06
2 files changed
+26
-14
No files matched your search
@@ -146,10 +146,10 @@ export function TimelineView() {
|
||||
const canAddLifeEvent = !caps.inSharedRecord;
|
||||
|
||||
// The zoom and a chosen range live in the URL (`timeline-url.ts`), so Back
|
||||
// and a bookmark return to them. Without a `zoom`, an incoming `?day=`
|
||||
// opens three months around that day and anything else the whole record.
|
||||
// and a bookmark return to them. Without a `zoom` the page opens on three
|
||||
// months: around an incoming `?day=`, otherwise up to today.
|
||||
const urlState = parseTimelineUrl(searchParams, today);
|
||||
const zoom: TimelineZoom = urlState.zoom ?? (dayParam ? "quarter" : "all");
|
||||
const zoom: TimelineZoom = urlState.zoom ?? "quarter";
|
||||
const range = zoom === "range" ? urlState.range : null;
|
||||
const [grouping, setGrouping] = useState<ChronicleGrouping>("month");
|
||||
// The selection follows `?day=` (Back, Forward, the day panel's previous
|
||||
|
||||
Reference in new issue
Block a user