2023-01-27 18:31:40 +01:00
|
|
|
import prisma from "@documenso/prisma";
|
2023-01-27 18:15:41 +01:00
|
|
|
import Head from "next/head";
|
2023-01-31 17:33:00 +01:00
|
|
|
import { ReactElement, useEffect } from "react";
|
2023-01-27 18:15:41 +01:00
|
|
|
import Layout from "../../../components/layout";
|
|
|
|
|
import Logo from "../../../components/logo";
|
|
|
|
|
import { NextPageWithLayout } from "../../_app";
|
2023-01-27 18:31:40 +01:00
|
|
|
import { Router } from "next/router";
|
|
|
|
|
import { ReadStatus } from "@prisma/client";
|
2023-01-31 17:33:00 +01:00
|
|
|
import SignaturePad from "signature_pad";
|
2023-01-27 18:15:41 +01:00
|
|
|
|
|
|
|
|
const SignPage: NextPageWithLayout = () => {
|
2023-01-31 17:33:00 +01:00
|
|
|
useEffect(() => {
|
|
|
|
|
const canvas: any = document.querySelector("canvas");
|
|
|
|
|
const signaturePad = new SignaturePad(canvas);
|
|
|
|
|
});
|
2023-01-27 18:15:41 +01:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Head>
|
|
|
|
|
<title>Sign | Documenso</title>
|
|
|
|
|
</Head>
|
|
|
|
|
Hello, please sign at the dotted line.
|
2023-01-31 17:33:00 +01:00
|
|
|
<canvas className="mx-auto bg-neon"></canvas>
|
|
|
|
|
<hr></hr>
|
2023-01-27 18:15:41 +01:00
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-27 18:31:40 +01:00
|
|
|
export async function getServerSideProps(context: any) {
|
|
|
|
|
const recipientToken: string = context.query["token"];
|
|
|
|
|
|
|
|
|
|
await prisma.recipient.updateMany({
|
|
|
|
|
where: {
|
|
|
|
|
token: recipientToken,
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
readStatus: ReadStatus.OPENED,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2023-01-27 20:14:32 +01:00
|
|
|
// todo sign ui
|
|
|
|
|
|
2023-01-27 18:31:40 +01:00
|
|
|
return {
|
|
|
|
|
props: {},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-27 18:15:41 +01:00
|
|
|
export default SignPage;
|