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"
|
import "react-mde/lib/styles/css/react-mde-all.css"
|
||||||
|
|
||||||
const NewPost = (props) => {
|
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 [selectedTab, setSelectedTab] = React.useState("write");
|
||||||
const submitPost = () => {
|
const submitPost = () => {
|
||||||
console.log("API CALL")
|
console.log(title)
|
||||||
console.log(value)
|
console.log(content)
|
||||||
}
|
}
|
||||||
return(
|
return(
|
||||||
<div className="container">
|
<div className="container">
|
||||||
|
<input
|
||||||
|
value={title}
|
||||||
|
placeholder="Title..."
|
||||||
|
onChange={e => setTitle(e.target.value)}
|
||||||
|
/>
|
||||||
|
|
||||||
<ReactMde
|
<ReactMde
|
||||||
value={value}
|
value={content}
|
||||||
onChange={setValue}
|
onChange={setContent}
|
||||||
selectedTab={selectedTab}
|
selectedTab={selectedTab}
|
||||||
onTabChange={setSelectedTab}
|
onTabChange={setSelectedTab}
|
||||||
generateMarkdownPreview={(markdown) =>
|
generateMarkdownPreview={(markdown) =>
|
||||||
|
|
Reference in a new issue