From 54cc70008a9e571f91cfe5e12cc1217fcf8510e8 Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Tue, 31 Jan 2023 16:16:22 +0100 Subject: [PATCH] recipient layout idea --- apps/web/pages/documents/[id]/recipients.tsx | 127 ++++++++++++++++++- 1 file changed, 120 insertions(+), 7 deletions(-) diff --git a/apps/web/pages/documents/[id]/recipients.tsx b/apps/web/pages/documents/[id]/recipients.tsx index ed8e50f97..631d15c9d 100644 --- a/apps/web/pages/documents/[id]/recipients.tsx +++ b/apps/web/pages/documents/[id]/recipients.tsx @@ -15,21 +15,120 @@ import { TrashIcon, UserPlusIcon, } from "@heroicons/react/20/solid"; -import { classNames } from "@documenso/lib"; +import { classNames, NEXT_PUBLIC_WEBAPP_URL } from "@documenso/lib"; import { + PaperAirplaneIcon, UserGroupIcon, UserIcon, UsersIcon, } from "@heroicons/react/24/outline"; +import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/20/solid"; +import { getUserFromToken } from "@documenso/lib/server"; -const RecipientsPage: NextPageWithLayout = () => { +const RecipientsPage: NextPageWithLayout = (props: any) => { + const title: string = + `"` + props?.document?.title + `"` + "Recipients | Documenso"; return ( <> - Documenttitle - Recipients | Documenso + {title} - -todo add signers ui -todo add breadcrumps -todo who will sign this - dropdown + {/* -todo add signers ui -todo add breadcrumps -todo who will sign this + dropdown */} +
+
+ + +
+
+
+

+ {props.document.title} +

+
+
+ + +
+
+
); }; @@ -39,9 +138,23 @@ RecipientsPage.getLayout = function getLayout(page: ReactElement) { }; export async function getServerSideProps(context: any) { - // todo get current document + const user = await getUserFromToken(context.req, context.res); + if (!user) return; + + const { id: documentId } = context.query; + const document = await prisma.document.findFirstOrThrow({ + where: { + id: +documentId, + }, + include: { + Recipient: true, + }, + }); + return { - props: {}, + props: { + document: document, + }, }; }