Fixed hooking up newpost
This commit is contained in:
parent
157d63deff
commit
59bfefd578
1 changed files with 12 additions and 5 deletions
|
@ -5,17 +5,24 @@ import 'github-markdown-css'
|
|||
import "react-mde/lib/styles/css/react-mde-all.css"
|
||||
|
||||
const NewPost = (props) => {
|
||||
const [value, setValue] = React.useState("**Hello world!!!**");
|
||||
const [title, setTitle] = React.useState("");
|
||||
const [content, setContent] = React.useState("");
|
||||
const [selectedTab, setSelectedTab] = React.useState("write");
|
||||
const submitPost = () => {
|
||||
console.log("API CALL")
|
||||
console.log(value)
|
||||
console.log(title)
|
||||
console.log(content)
|
||||
}
|
||||
return(
|
||||
<div className="container">
|
||||
<input
|
||||
value={title}
|
||||
placeholder="Title..."
|
||||
onChange={e => setTitle(e.target.value)}
|
||||
/>
|
||||
|
||||
<ReactMde
|
||||
value={value}
|
||||
onChange={setValue}
|
||||
value={content}
|
||||
onChange={setContent}
|
||||
selectedTab={selectedTab}
|
||||
onTabChange={setSelectedTab}
|
||||
generateMarkdownPreview={(markdown) =>
|
||||
|
|
Reference in a new issue