From ecd89fdf0e183bec519f3f681356cc241951dcc5 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Sun, 6 Mar 2022 22:16:08 -0800 Subject: [PATCH] Post permissions --- client/components/document/index.tsx | 5 +- client/pages/api/hello.ts | 13 ------ client/pages/post/[id].tsx | 70 ++++++++++++++++++---------- client/styles/Home.module.css | 11 ++++- client/styles/globals.css | 6 +++ server/src/routes/posts.ts | 14 ++++-- 6 files changed, 76 insertions(+), 43 deletions(-) delete mode 100644 client/pages/api/hello.ts diff --git a/client/components/document/index.tsx b/client/components/document/index.tsx index 9edb414..ece89ec 100644 --- a/client/components/document/index.tsx +++ b/client/components/document/index.tsx @@ -10,9 +10,10 @@ type Props = { content?: string setTitle?: (title: string) => void setContent?: (content: string) => void + initialTab?: "edit" | "preview" } -const Document = ({ remove, editable, title, content, setTitle, setContent }: Props) => { +const Document = ({ remove, editable, title, content, setTitle, setContent, initialTab = 'edit' }: Props) => { const codeEditorRef = useRef(null) const removeFile = (remove?: () => void) => { @@ -45,7 +46,7 @@ const Document = ({ remove, editable, title, content, setTitle, setContent }: Pr {remove && editable &&