fix: restore arrow key week navigation; improve empty state copy
All checks were successful
Build and Deploy / Build & Push (push) Successful in 1m6s
All checks were successful
Build and Deploy / Build & Push (push) Successful in 1m6s
- WeekNav: add keydown listener for ArrowLeft/ArrowRight week nav - EmptyState: replace dev-facing "No data scraped yet" + npm commands with customer-friendly "Schedule not available yet" message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
interface WeekNavProps {
|
||||
@@ -35,6 +36,16 @@ export function WeekNav({ weekStart, weekDates, isCurrentWeek }: WeekNavProps) {
|
||||
const nav = (delta: number) =>
|
||||
router.push(`/?week=${shiftWeek(weekStart, delta)}`);
|
||||
|
||||
useEffect(() => {
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
|
||||
if (e.key === "ArrowLeft") nav(-1);
|
||||
if (e.key === "ArrowRight") nav(1);
|
||||
};
|
||||
window.addEventListener("keydown", onKey);
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [weekStart]);
|
||||
|
||||
return (
|
||||
<div style={{ display: "flex", alignItems: "center", gap: 8 }}>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user