mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
✨ download after signing
This commit is contained in:
@ -1,12 +1,17 @@
|
|||||||
import prisma from "@documenso/prisma";
|
import prisma from "@documenso/prisma";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { NextPageWithLayout } from "../../_app";
|
import { NextPageWithLayout } from "../../_app";
|
||||||
import { ReadStatus } from "@prisma/client";
|
import { ArrowDownTrayIcon, CheckBadgeIcon } from "@heroicons/react/24/outline";
|
||||||
import { CheckBadgeIcon } from "@heroicons/react/24/outline";
|
import { Button, IconButton } from "@documenso/ui";
|
||||||
import { Button } from "@documenso/ui";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
const SignPage: NextPageWithLayout = (props: any) => {
|
const SignPage: NextPageWithLayout = (props: any) => {
|
||||||
|
const router = useRouter();
|
||||||
|
const allRecipientsSigned = props.document.Recipient?.every(
|
||||||
|
(r: any) => r.signingStatus === "SIGNED"
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
@ -20,9 +25,34 @@ const SignPage: NextPageWithLayout = (props: any) => {
|
|||||||
<p className="mt-2 text-4xl font-bold tracking-tight">
|
<p className="mt-2 text-4xl font-bold tracking-tight">
|
||||||
You signed "{props.document.title}"
|
You signed "{props.document.title}"
|
||||||
</p>
|
</p>
|
||||||
<p className="mt-2 text-base text-gray-500 max-w-sm">
|
<p
|
||||||
|
className="mt-2 text-base text-gray-500 max-w-sm"
|
||||||
|
hidden={allRecipientsSigned}
|
||||||
|
>
|
||||||
You will be notfied when all recipients have signed.
|
You will be notfied when all recipients have signed.
|
||||||
</p>
|
</p>
|
||||||
|
<p
|
||||||
|
className="mt-2 text-base text-gray-500 max-w-sm"
|
||||||
|
hidden={!allRecipientsSigned}
|
||||||
|
>
|
||||||
|
All recipients signed.
|
||||||
|
</p>
|
||||||
|
<div
|
||||||
|
className="mx-auto w-fit text-xl pt-20"
|
||||||
|
hidden={!allRecipientsSigned}
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
icon={ArrowDownTrayIcon}
|
||||||
|
color="secondary"
|
||||||
|
onClick={(event: any) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
router.push("/api/documents/" + props.document.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Download Document
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div className="relative mx-96">
|
<div className="relative mx-96">
|
||||||
@ -53,7 +83,7 @@ export async function getServerSideProps(context: any) {
|
|||||||
token: recipientToken,
|
token: recipientToken,
|
||||||
},
|
},
|
||||||
include: {
|
include: {
|
||||||
Document: true,
|
Document: { include: { Recipient: true } },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user