fix(image): bad image url input field name
This commit is contained in:
parent
0026f4d751
commit
7244591d34
@ -30,7 +30,7 @@ export const WritePage = () => {
|
|||||||
const blog = data?.blog
|
const blog = data?.blog
|
||||||
const title = data?.blog ? 'Edit blog post' : 'Submit a blog post'
|
const title = data?.blog ? 'Edit blog post' : 'Submit a blog post'
|
||||||
const [content, setContent] = useState(blog?.content || '')
|
const [content, setContent] = useState(blog?.content || '')
|
||||||
const [featuredImageUrl, setfeaturedImageUrl] = useState(blog?.image || '')
|
const [image, setImage] = useState(blog?.image || '')
|
||||||
|
|
||||||
const formRef = useRef<HTMLFormElement>(null)
|
const formRef = useRef<HTMLFormElement>(null)
|
||||||
const editorRef = useRef<EditorRef>(null)
|
const editorRef = useRef<EditorRef>(null)
|
||||||
@ -45,6 +45,9 @@ export const WritePage = () => {
|
|||||||
// Cancel if not confirmed
|
// Cancel if not confirmed
|
||||||
if (!confirm) return
|
if (!confirm) return
|
||||||
|
|
||||||
|
// Reset featured image
|
||||||
|
setImage(blog?.image || '')
|
||||||
|
|
||||||
// Reset editor
|
// Reset editor
|
||||||
if (blog?.content) {
|
if (blog?.content) {
|
||||||
editorRef.current?.setMarkdown(blog?.content)
|
editorRef.current?.setMarkdown(blog?.content)
|
||||||
@ -103,12 +106,12 @@ export const WritePage = () => {
|
|||||||
</div>
|
</div>
|
||||||
<InputFieldWithImageUpload
|
<InputFieldWithImageUpload
|
||||||
label='Featured Image URL'
|
label='Featured Image URL'
|
||||||
|
name='image'
|
||||||
inputMode='url'
|
inputMode='url'
|
||||||
placeholder='Image URL'
|
value={image}
|
||||||
name='featuredImageUrl'
|
|
||||||
value={featuredImageUrl}
|
|
||||||
error={formErrors?.image}
|
error={formErrors?.image}
|
||||||
onInputChange={(_, value) => setfeaturedImageUrl(value)}
|
onInputChange={(_, value) => setImage(value)}
|
||||||
|
placeholder='Image URL'
|
||||||
/>
|
/>
|
||||||
<InputFieldUncontrolled
|
<InputFieldUncontrolled
|
||||||
label='Summary'
|
label='Summary'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user