Fix menu/settings navigation using Link
This commit is contained in:
parent
ea43646f48
commit
dea394f566
1 changed files with 13 additions and 11 deletions
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
|
|
||||||
const OFFLINE_QUEUE_KEY = "tia_offline_queue";
|
const OFFLINE_QUEUE_KEY = "tia_offline_queue";
|
||||||
|
|
||||||
|
|
@ -174,7 +173,6 @@ function getGreeting() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function HomePage() {
|
export default function HomePage() {
|
||||||
const router = useRouter();
|
|
||||||
const [modalType, setModalType] = useState<"feed" | "diaper" | "sleep" | null>(null);
|
const [modalType, setModalType] = useState<"feed" | "diaper" | "sleep" | null>(null);
|
||||||
const [childId] = useState("5ad3b16a-1e0d-45ab-bc91-038397d75d0a");
|
const [childId] = useState("5ad3b16a-1e0d-45ab-bc91-038397d75d0a");
|
||||||
const [pendingCount, setPendingCount] = useState(0);
|
const [pendingCount, setPendingCount] = useState(0);
|
||||||
|
|
@ -209,18 +207,22 @@ export default function HomePage() {
|
||||||
}, [childId]);
|
}, [childId]);
|
||||||
|
|
||||||
return (
|
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 */}
|
{/* Header */}
|
||||||
<div className="p-4 flex justify-between items-center">
|
<div className="p-4 flex justify-between items-center">
|
||||||
<button onClick={() => router.push("/menu")} className="p-2">
|
<button className="p-2">
|
||||||
|
<Link href="/menu">
|
||||||
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<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" />
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
|
||||||
</svg>
|
</svg>
|
||||||
|
</Link>
|
||||||
</button>
|
</button>
|
||||||
<button onClick={() => router.push("/settings")} className="p-2">
|
<button className="p-2">
|
||||||
|
<Link href="/settings">
|
||||||
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<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" />
|
<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>
|
</svg>
|
||||||
|
</Link>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue