mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 01:32:06 +10:00
status tooltip, recipient page
This commit is contained in:
@ -5,23 +5,69 @@ import { Document, Page, pdfjs } from "react-pdf";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useRouter } from "next/router";
|
||||
import { NEXT_PUBLIC_WEBAPP_URL } from "@documenso/lib";
|
||||
import prisma from "@documenso/prisma";
|
||||
import { getUserFromToken } from "@documenso/lib/server";
|
||||
import Logo from "../../../components/logo";
|
||||
import Link from "next/link";
|
||||
|
||||
const PDFViewer = dynamic(() => import("../../../components/pdf-viewer"), {
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
const DocumentsDetailPage: NextPageWithLayout = () => {
|
||||
const DocumentsDetailPage: NextPageWithLayout = (props: any) => {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<div className="mx-auto w-fit">
|
||||
<PDFViewer
|
||||
pdfUrl={`${NEXT_PUBLIC_WEBAPP_URL}/api/documents/${router.query.id}`}
|
||||
/>
|
||||
<div className="mx-auto w-fit p-4">
|
||||
<div className="mx-auto w-auto text-left">
|
||||
<div>
|
||||
<h3 className="font-medium leading-tight text-3xl mt-0 mb-2 text-neon">
|
||||
{props.document.title}
|
||||
</h3>
|
||||
<Link
|
||||
type="a"
|
||||
href={
|
||||
NEXT_PUBLIC_WEBAPP_URL +
|
||||
"/documents/" +
|
||||
props.document.id +
|
||||
"/recipients"
|
||||
}
|
||||
className="inline-flex items-center justify-center rounded-md border border-transparent bg-neon px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-neon-dark focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:w-auto"
|
||||
>
|
||||
Add Signers
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<div className="">
|
||||
<PDFViewer
|
||||
pdfUrl={`${NEXT_PUBLIC_WEBAPP_URL}/api/documents/${router.query.id}`}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export async function getServerSideProps(context: any) {
|
||||
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,
|
||||
},
|
||||
});
|
||||
|
||||
// todo optimize querys
|
||||
// todo no intersection groups
|
||||
|
||||
return {
|
||||
props: {
|
||||
document: document,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
DocumentsDetailPage.getLayout = function getLayout(page: ReactElement) {
|
||||
return <Layout>{page}</Layout>;
|
||||
};
|
||||
|
||||
48
apps/web/pages/documents/[id]/recipients.tsx
Normal file
48
apps/web/pages/documents/[id]/recipients.tsx
Normal file
@ -0,0 +1,48 @@
|
||||
import prisma from "@documenso/prisma";
|
||||
import Head from "next/head";
|
||||
import { ReactElement } from "react";
|
||||
import Layout from "../../../components/layout";
|
||||
import { NextPageWithLayout } from "../../_app";
|
||||
import { Fragment } from "react";
|
||||
import { Menu, Transition } from "@headlessui/react";
|
||||
import {
|
||||
ArchiveBoxIcon,
|
||||
ArrowRightCircleIcon,
|
||||
ChevronDownIcon,
|
||||
DocumentDuplicateIcon,
|
||||
HeartIcon,
|
||||
PencilSquareIcon,
|
||||
TrashIcon,
|
||||
UserPlusIcon,
|
||||
} from "@heroicons/react/20/solid";
|
||||
import { classNames } from "@documenso/lib";
|
||||
import {
|
||||
UserGroupIcon,
|
||||
UserIcon,
|
||||
UsersIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
|
||||
const RecipientsPage: NextPageWithLayout = () => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Documenttitle - Recipients | Documenso</title>
|
||||
</Head>
|
||||
-todo add signers ui -todo add breadcrumps -todo who will sign this
|
||||
dropdown
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
RecipientsPage.getLayout = function getLayout(page: ReactElement) {
|
||||
return <Layout>{page}</Layout>;
|
||||
};
|
||||
|
||||
export async function getServerSideProps(context: any) {
|
||||
// todo get current document
|
||||
return {
|
||||
props: {},
|
||||
};
|
||||
}
|
||||
|
||||
export default RecipientsPage;
|
||||
Reference in New Issue
Block a user