From cebe5a7239ec1a71dda531dbb2530c5528c6fbe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Thu, 15 Feb 2024 15:52:27 +0100 Subject: [PATCH] delete forms were not wrapped in
--- app/bill/[id]/delete/page.tsx | 7 ++++++- app/location/[id]/delete/page.tsx | 7 ++++++- app/ui/BillDeleteForm.tsx | 26 ++++++++++++-------------- app/ui/LocationEditForm.tsx | 4 ++-- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/app/bill/[id]/delete/page.tsx b/app/bill/[id]/delete/page.tsx index 6b9d211..82edc3d 100644 --- a/app/bill/[id]/delete/page.tsx +++ b/app/bill/[id]/delete/page.tsx @@ -3,6 +3,7 @@ import { fetchLocationById } from '@/app/lib/actions/locationActions'; import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm'; import { BillDeleteForm } from '@/app/ui/BillDeleteForm'; import { fetchBillById } from '@/app/lib/actions/billActions'; +import { Main } from '@/app/ui/Main'; export default async function Page({ params:{ id } }: { params: { id:string } }) { const [locationID, billID] = id.split('-'); @@ -13,5 +14,9 @@ export default async function Page({ params:{ id } }: { params: { id:string } }) return(notFound()); } - return (); + return ( +
+ +
+ ); } \ No newline at end of file diff --git a/app/location/[id]/delete/page.tsx b/app/location/[id]/delete/page.tsx index f4d8d44..40c7b8e 100644 --- a/app/location/[id]/delete/page.tsx +++ b/app/location/[id]/delete/page.tsx @@ -1,6 +1,7 @@ import { notFound } from 'next/navigation'; import { fetchLocationById } from '@/app/lib/actions/locationActions'; import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm'; +import { Main } from '@/app/ui/Main'; export default async function Page({ params:{ id } }: { params: { id:string } }) { @@ -10,5 +11,9 @@ export default async function Page({ params:{ id } }: { params: { id:string } }) return(notFound()); } - return (); + return ( +
+ +
+ ); } \ No newline at end of file diff --git a/app/ui/BillDeleteForm.tsx b/app/ui/BillDeleteForm.tsx index f12fc50..7317d8f 100644 --- a/app/ui/BillDeleteForm.tsx +++ b/app/ui/BillDeleteForm.tsx @@ -20,20 +20,18 @@ export const BillDeleteForm:FC = ({ bill, location }) => { return( -
-
-
-
-

- Please confirm deletion of bill “{bill.name}” at “{location.name}”. -

-
- - Cancel -
-
-
+
+
+
+

+ Please confirm deletion of bill “{bill.name}” at “{location.name}”. +

+
+ + Cancel +
+
-
+ ) } diff --git a/app/ui/LocationEditForm.tsx b/app/ui/LocationEditForm.tsx index b1fdc29..78a5af5 100644 --- a/app/ui/LocationEditForm.tsx +++ b/app/ui/LocationEditForm.tsx @@ -37,7 +37,7 @@ export const LocationEditForm:FC = ({ location, yearMonth } - +
{state.errors?.locationName && state.errors.locationName.map((error: string) => ( @@ -47,7 +47,7 @@ export const LocationEditForm:FC = ({ location, yearMonth ))}
- +
{state.errors?.locationNotes && state.errors.locationNotes.map((error: string) => (