diff --git a/bun.lockb b/bun.lockb index b78bfa4b..ed2714fb 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index e1794cb2..7b5bd30d 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "next": "^13.5.4", "next-auth": "^4.24.4", "react": "18.2.0", + "react-beautiful-dnd": "^13.1.1", "react-dom": "18.2.0", "react-icons": "^4.11.0", "superjson": "^1.13.1", @@ -35,6 +36,7 @@ "@types/eslint": "^8.44.2", "@types/node": "^18.16.0", "@types/react": "^18.2.20", + "@types/react-beautiful-dnd": "^13.1.7", "@types/react-dom": "^18.2.7", "@typescript-eslint/eslint-plugin": "^6.3.0", "@typescript-eslint/parser": "^6.3.0", diff --git a/src/app/boards/[...id]/page.tsx b/src/app/boards/[...id]/page.tsx index f4a4c342..5610631a 100644 --- a/src/app/boards/[...id]/page.tsx +++ b/src/app/boards/[...id]/page.tsx @@ -1,15 +1,93 @@ "use client"; +import { useParams } from "next/navigation"; +import { HiOutlinePlusSmall } from "react-icons/hi2"; +import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd"; + import { api } from "~/trpc/react"; -export default function BoardPage({ params }: { params: { id: string[] } }) { - const boardId = params.id[0]; +interface List { + publicId: string; + name: string; + cards?: Card[]; +} + +interface Card { + publicId: string; + title: string; +} + +export default function BoardPage() { + const params = useParams(); + + const boardId = params?.id?.length && params.id[0]; if (!boardId) return <>; const { data } = api.board.byId.useQuery({ id: boardId }); - console.log({ data }); + const onDragEnd = () => null; - return <>; + return ( +
+
+

+ {data?.name} +

+
+ +
+
+ + +
+ {data?.lists.map((list: List) => ( + + {(provided) => ( +
+

+ {list.name} +

+ + {list.cards?.map((card, index) => ( + + {(provided) => ( +
+

{card.title}

+
+ )} +
+ ))} +
+ )} +
+ ))} +
+
+
+ ); }