From 7244591d34c77ccd702d3e2aca84810ea12da086 Mon Sep 17 00:00:00 2001 From: e Date: Tue, 7 Jan 2025 14:31:19 +0100 Subject: [PATCH] fix(image): bad image url input field name --- src/pages/write/index.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pages/write/index.tsx b/src/pages/write/index.tsx index 9f21d31..fe4f586 100644 --- a/src/pages/write/index.tsx +++ b/src/pages/write/index.tsx @@ -30,7 +30,7 @@ export const WritePage = () => { const blog = data?.blog const title = data?.blog ? 'Edit blog post' : 'Submit a blog post' const [content, setContent] = useState(blog?.content || '') - const [featuredImageUrl, setfeaturedImageUrl] = useState(blog?.image || '') + const [image, setImage] = useState(blog?.image || '') const formRef = useRef(null) const editorRef = useRef(null) @@ -45,6 +45,9 @@ export const WritePage = () => { // Cancel if not confirmed if (!confirm) return + // Reset featured image + setImage(blog?.image || '') + // Reset editor if (blog?.content) { editorRef.current?.setMarkdown(blog?.content) @@ -103,12 +106,12 @@ export const WritePage = () => { setfeaturedImageUrl(value)} + onInputChange={(_, value) => setImage(value)} + placeholder='Image URL' />