From 7fd4b8d3e24ac7fe8184de37c559d4a36d1a0ab1 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 23 Jun 2024 23:28:04 +0200 Subject: [PATCH] Refactoring --- src/components/client/admin/PostEditor.tsx | 17 +++- src/components/client/admin/PostTable.tsx | 110 ++++++++++----------- 2 files changed, 66 insertions(+), 61 deletions(-) diff --git a/src/components/client/admin/PostEditor.tsx b/src/components/client/admin/PostEditor.tsx index 75ea623..28be387 100644 --- a/src/components/client/admin/PostEditor.tsx +++ b/src/components/client/admin/PostEditor.tsx @@ -14,7 +14,7 @@ type PostEditorBucket = Partial> & { attachments:Partial>[] } -type PostEditorPost = Partial> & { +export type PostEditorPost = Attributes & { buckets:PostEditorBucket[] } @@ -32,7 +32,7 @@ export default function PostEditor(props:EditorProps){ let [projectID,setProjectID] = useState(props.post?.project_id) let textbox:any = useRef(undefined); - function adjustHeight() { + function adjustHeight(): void { if(!textbox.current || !textbox.current.style) return textbox.current.style.height = "fit-content"; textbox.current.style.height = `${textbox.current.scrollHeight}px`; @@ -57,9 +57,18 @@ export default function PostEditor(props:EditorProps){

Title

setTitle(e.target.value)} type='text' className="m-2">

Content

- +