diff --git a/src/app/garden/containers/[id]/page.tsx b/src/app/garden/containers/[id]/page.tsx index b9ebdab..7b05381 100644 --- a/src/app/garden/containers/[id]/page.tsx +++ b/src/app/garden/containers/[id]/page.tsx @@ -1,7 +1,8 @@ import { notFound } from "next/navigation"; -import { getContainer } from "@/modules/garden/server/queries"; -import { ContainerDetail } from "@/modules/garden/components/container-detail"; +import { DetailBackLink } from "@/components/detail-back-link"; import { getShareLinksForEntity } from "@/modules/_core/share"; +import { ContainerDetail } from "@/modules/garden/components/container-detail"; +import { getContainer } from "@/modules/garden/server/queries"; export default async function ContainerPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; @@ -12,6 +13,7 @@ export default async function ContainerPage({ params }: { params: Promise<{ id: if (!container) notFound(); return (
+
); diff --git a/src/app/garden/containers/new/page.tsx b/src/app/garden/containers/new/page.tsx index 996a2ca..d83a76b 100644 --- a/src/app/garden/containers/new/page.tsx +++ b/src/app/garden/containers/new/page.tsx @@ -1,4 +1,5 @@ import { redirect } from "next/navigation"; +import { DetailBackLink } from "@/components/detail-back-link"; import { createContainer } from "@/modules/garden/server/actions"; export default function NewContainerPage() { @@ -14,21 +15,8 @@ export default function NewContainerPage() { return (
-
- - - - - +
+

New container

diff --git a/src/app/garden/plants/[id]/edit/page.tsx b/src/app/garden/plants/[id]/edit/page.tsx index 84da193..4a28732 100644 --- a/src/app/garden/plants/[id]/edit/page.tsx +++ b/src/app/garden/plants/[id]/edit/page.tsx @@ -1,6 +1,7 @@ import { notFound } from "next/navigation"; -import { getPlant, listContainers } from "@/modules/garden/server/queries"; +import { DetailBackLink } from "@/components/detail-back-link"; import { PlantForm } from "@/modules/garden/components/plant-form"; +import { getPlant, listContainers } from "@/modules/garden/server/queries"; export default async function EditPlantPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; @@ -9,6 +10,7 @@ export default async function EditPlantPage({ params }: { params: Promise<{ id: return (
+

Edit Plant

diff --git a/src/app/garden/plants/[id]/page.tsx b/src/app/garden/plants/[id]/page.tsx index 46a49df..3310c84 100644 --- a/src/app/garden/plants/[id]/page.tsx +++ b/src/app/garden/plants/[id]/page.tsx @@ -1,8 +1,9 @@ import { notFound } from "next/navigation"; +import { DetailBackLink } from "@/components/detail-back-link"; +import { getShareLinksForEntity } from "@/modules/_core/share"; +import { PlantDetail } from "@/modules/garden/components/plant-detail"; import { listCalendars } from "@/modules/garden/server/calendar-bridge"; import { getCareLogs, getCareSchedules, getPlant } from "@/modules/garden/server/queries"; -import { PlantDetail } from "@/modules/garden/components/plant-detail"; -import { getShareLinksForEntity } from "@/modules/_core/share"; export default async function PlantPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; @@ -17,6 +18,7 @@ export default async function PlantPage({ params }: { params: Promise<{ id: stri return (
+ -
- - - - - +
+

Add Plant

diff --git a/src/app/settings/household/page.tsx b/src/app/settings/household/page.tsx index cd9fd76..059db6b 100644 --- a/src/app/settings/household/page.tsx +++ b/src/app/settings/household/page.tsx @@ -1,10 +1,11 @@ import { eq } from "drizzle-orm"; -import { db } from "@/lib/db"; -import { getCurrentSession } from "@/lib/session"; -import { householdMembers, users } from "@/modules/_core/schema"; +import { DetailBackLink } from "@/components/detail-back-link"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { db } from "@/lib/db"; +import { getCurrentSession } from "@/lib/session"; +import { householdMembers, users } from "@/modules/_core/schema"; import { renameHousehold } from "./actions"; export default async function HouseholdSettingsPage() { @@ -18,6 +19,7 @@ export default async function HouseholdSettingsPage() { return (
+

Household Settings

diff --git a/src/components/detail-back-link.tsx b/src/components/detail-back-link.tsx new file mode 100644 index 0000000..959c500 --- /dev/null +++ b/src/components/detail-back-link.tsx @@ -0,0 +1,25 @@ +import Link from "next/link"; +import { ArrowLeft } from "lucide-react"; +import { cn } from "@/lib/utils"; + +type DetailBackLinkProps = { + href: string; + label: string; + className?: string; +}; + +export function DetailBackLink({ href, label, className }: DetailBackLinkProps) { + return ( + +