Skip to content

The Open Source DocuSign Alternative.

qoc, todo, document detail page

Timur Ercan7a3e19f6273e
diff --git a/apps/web/components/navigation.tsx b/apps/web/components/navigation.tsx
index e326cb240..d73d42fa6 100644
--- a/apps/web/components/navigation.tsx
+++ b/apps/web/components/navigation.tsx
@@ -86,7 +86,7 @@ export default function TopNavigation() {
const router = useRouter();
navigation.forEach((element) => {
- element.current = router.route.startsWith("/" + element.href.split("/")[1]);
+ element.current = router.route.endsWith("/" + element.href.split("/")[1]);
});
return (
diff --git a/apps/web/pages/api/documents/index.ts b/apps/web/pages/api/documents/index.ts
index 3e1edea7d..4feaa8ddc 100644
--- a/apps/web/pages/api/documents/index.ts
+++ b/apps/web/pages/api/documents/index.ts
@@ -6,6 +6,7 @@ import { useSession } from "next-auth/react";
import { buffer } from "stream/consumers";
async function postHandler(req: NextApiRequest, res: NextApiResponse) {
+ // todo move token validation to import
const token = await getToken({ req });
const tokenEmail = token?.email?.toString();
if (!token) {
diff --git a/apps/web/pages/documents.tsx b/apps/web/pages/documents.tsx
index 5d574cd85..0b3966c96 100644
--- a/apps/web/pages/documents.tsx
+++ b/apps/web/pages/documents.tsx
@@ -1,25 +1,11 @@
import { useSession } from "next-auth/react";
import type { ReactElement } from "react";
import Layout from "../components/layout";
-import Settings from "../components/settings";
import type { NextPageWithLayout } from "./_app";
-import { SessionProvider } from "next-auth/react";
import Head from "next/head";
import { PlusIcon } from "@heroicons/react/24/outline";
const DocumentsPage: NextPageWithLayout = () => {
- const { data: session } = useSession();
-
- const people = [
- {
- name: "NDA acme Corps",
- title: "✉ Sent",
- email: "12.01.2023 16:08",
- role: "",
- },
- // More people...
- ];
-
return (
<>
<Head>
@@ -50,7 +36,7 @@ const DocumentsPage: NextPageWithLayout = () => {
className="inline-flex items-center rounded-md border border-transparent bg-neon px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
>
<PlusIcon className="-ml-1 mr-2 h-5 w-5" aria-hidden="true" />
- Upload PDF Document
+ Upload Document
</button>
</div>
</div>
diff --git a/apps/web/pages/documents/[id].tsx b/apps/web/pages/documents/[id].tsx
new file mode 100644
index 000000000..9cfa7f53b
--- /dev/null
+++ b/apps/web/pages/documents/[id].tsx
@@ -0,0 +1,13 @@
+import { ReactElement } from "react";
+import Layout from "../../components/layout";
+import { NextPageWithLayout } from "../_app";
+
+const DocumentsDetailPage: NextPageWithLayout = () => {
+ return <>docs</>;
+};
+
+DocumentsDetailPage.getLayout = function getLayout(page: ReactElement) {
+ return <Layout>{page}</Layout>;
+};
+
+export default DocumentsDetailPage;