Fix menu/settings navigation using Link

This commit is contained in:
Manohar Gupta 2026-05-10 11:02:50 +05:30
parent ea43646f48
commit dea394f566

View file

@ -2,7 +2,6 @@
import { useState, useEffect } from "react";
import Link from "next/link";
import { useRouter } from "next/navigation";
const OFFLINE_QUEUE_KEY = "tia_offline_queue";
@ -174,7 +173,6 @@ function getGreeting() {
}
export default function HomePage() {
const router = useRouter();
const [modalType, setModalType] = useState<"feed" | "diaper" | "sleep" | null>(null);
const [childId] = useState("5ad3b16a-1e0d-45ab-bc91-038397d75d0a");
const [pendingCount, setPendingCount] = useState(0);
@ -209,18 +207,22 @@ export default function HomePage() {
}, [childId]);
return (
<div className="min-h-screen bg-gradient-to-br from-rose-50 to-amber-50">
<div className="min-h-screen bg-gradient-to-br from-rose-50 to-amber-50 dark:from-gray-900 dark:to-gray-800">
{/* Header */}
<div className="p-4 flex justify-between items-center">
<button onClick={() => router.push("/menu")} className="p-2">
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
</svg>
<button className="p-2">
<Link href="/menu">
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
</svg>
</Link>
</button>
<button onClick={() => router.push("/settings")} className="p-2">
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.83-1.419 2.366-2.317 4.083-2.317 1.717 0 3.253.898 4.083 2.317M12 12h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<button className="p-2">
<Link href="/settings">
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.83-1.419 2.366-2.317 4.083-2.317 1.717 0 3.253.898 4.083 2.317M12 12h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</Link>
</button>
</div>