fix: "← Calendar" returns to the previously viewed week
All checks were successful
Build and Deploy / Build & Push (push) Successful in 1m3s
All checks were successful
Build and Deploy / Build & Push (push) Successful in 1m3s
HomePageClient writes the current weekStart to localStorage("lastWeek")
whenever it changes. BackToCalendarLink (new client component) reads
that value on mount and builds the href — falling back to "/" if nothing
is stored (e.g. direct link to a park page).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Link from "next/link";
|
||||
import { BackToCalendarLink } from "@/components/BackToCalendarLink";
|
||||
import { notFound } from "next/navigation";
|
||||
import { PARK_MAP } from "@/lib/parks";
|
||||
import { openDb, getParkMonthData, getApiId } from "@/lib/db";
|
||||
@@ -93,19 +94,7 @@ export default async function ParkPage({ params, searchParams }: PageProps) {
|
||||
alignItems: "center",
|
||||
gap: 16,
|
||||
}}>
|
||||
<Link href="/" style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: 6,
|
||||
fontSize: "0.8rem",
|
||||
color: "var(--color-text-muted)",
|
||||
textDecoration: "none",
|
||||
transition: "color 120ms ease",
|
||||
}}
|
||||
className="park-name-link"
|
||||
>
|
||||
← Calendar
|
||||
</Link>
|
||||
<BackToCalendarLink />
|
||||
<div style={{ width: 1, height: 16, background: "var(--color-border)" }} />
|
||||
<span style={{ fontSize: "0.9rem", fontWeight: 600, color: "var(--color-text)", letterSpacing: "-0.01em" }}>
|
||||
{park.name}
|
||||
|
||||
Reference in New Issue
Block a user