qoc, todo, document detail page

This commit is contained in:
Timur Ercan
2023-01-19 17:42:20 +01:00
parent 9d70459387
commit 7a3e19f627
4 changed files with 16 additions and 16 deletions

View File

@ -86,7 +86,7 @@ export default function TopNavigation() {
const router = useRouter(); const router = useRouter();
navigation.forEach((element) => { navigation.forEach((element) => {
element.current = router.route.startsWith("/" + element.href.split("/")[1]); element.current = router.route.endsWith("/" + element.href.split("/")[1]);
}); });
return ( return (

View File

@ -6,6 +6,7 @@ import { useSession } from "next-auth/react";
import { buffer } from "stream/consumers"; import { buffer } from "stream/consumers";
async function postHandler(req: NextApiRequest, res: NextApiResponse) { async function postHandler(req: NextApiRequest, res: NextApiResponse) {
// todo move token validation to import
const token = await getToken({ req }); const token = await getToken({ req });
const tokenEmail = token?.email?.toString(); const tokenEmail = token?.email?.toString();
if (!token) { if (!token) {

View File

@ -1,25 +1,11 @@
import { useSession } from "next-auth/react"; import { useSession } from "next-auth/react";
import type { ReactElement } from "react"; import type { ReactElement } from "react";
import Layout from "../components/layout"; import Layout from "../components/layout";
import Settings from "../components/settings";
import type { NextPageWithLayout } from "./_app"; import type { NextPageWithLayout } from "./_app";
import { SessionProvider } from "next-auth/react";
import Head from "next/head"; import Head from "next/head";
import { PlusIcon } from "@heroicons/react/24/outline"; import { PlusIcon } from "@heroicons/react/24/outline";
const DocumentsPage: NextPageWithLayout = () => { 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 ( return (
<> <>
<Head> <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" 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" /> <PlusIcon className="-ml-1 mr-2 h-5 w-5" aria-hidden="true" />
Upload PDF Document Upload Document
</button> </button>
</div> </div>
</div> </div>

View File

@ -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;