From 09b2b084214020ec8b39a378d5193b342cd8bb4e Mon Sep 17 00:00:00 2001 From: Asara Date: Sat, 19 Oct 2019 21:54:59 -0400 Subject: [PATCH] Flesh out posting --- src/components/NewPost.js | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/components/NewPost.js b/src/components/NewPost.js index f6a780b..b57fcca 100644 --- a/src/components/NewPost.js +++ b/src/components/NewPost.js @@ -7,11 +7,18 @@ import "react-mde/lib/styles/css/react-mde-all.css" const NewPost = (props) => { const [title, setTitle] = React.useState(""); const [content, setContent] = React.useState(""); + const [tags, setTags] = React.useState(""); const [selectedTab, setSelectedTab] = React.useState("write"); + const submitPost = () => { - console.log(title) - console.log(content) + const payload = { + title: title, + content: content, + tags: tags, + } + console.log(payload) } + return(
{ onChange={e => setTitle(e.target.value)} /> - - Promise.resolve()} +
+ + Promise.resolve()} + /> +
+ setTags(e.target.value)} /> - +
+ +
) }