Fixing up the post, cleaning up depends
This commit is contained in:
parent
bd20aecb06
commit
157d63deff
3 changed files with 17 additions and 14 deletions
|
@ -14,7 +14,6 @@
|
||||||
"react-scripts": "3.0.0",
|
"react-scripts": "3.0.0",
|
||||||
"redux": "^4.0.4",
|
"redux": "^4.0.4",
|
||||||
"redux-thunk": "^2.3.0",
|
"redux-thunk": "^2.3.0",
|
||||||
"semantic-ui-react": "^0.87.3",
|
|
||||||
"universal-cookie": "^4.0.2"
|
"universal-cookie": "^4.0.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
|
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#EEEEEE" />
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css">
|
||||||
<!--
|
<!--
|
||||||
manifest.json provides metadata used when your web app is installed on a
|
manifest.json provides metadata used when your web app is installed on a
|
||||||
|
|
|
@ -7,18 +7,23 @@ import "react-mde/lib/styles/css/react-mde-all.css"
|
||||||
const NewPost = (props) => {
|
const NewPost = (props) => {
|
||||||
const [value, setValue] = React.useState("**Hello world!!!**");
|
const [value, setValue] = React.useState("**Hello world!!!**");
|
||||||
const [selectedTab, setSelectedTab] = React.useState("write");
|
const [selectedTab, setSelectedTab] = React.useState("write");
|
||||||
return(
|
const submitPost = () => {
|
||||||
<div className="container">
|
console.log("API CALL")
|
||||||
<ReactMde
|
console.log(value)
|
||||||
value={value}
|
}
|
||||||
onChange={setValue}
|
return(
|
||||||
selectedTab={selectedTab}
|
<div className="container">
|
||||||
onTabChange={setSelectedTab}
|
<ReactMde
|
||||||
generateMarkdownPreview={(markdown) =>
|
value={value}
|
||||||
Promise.resolve(<ReactMarkdown source={markdown} />)}
|
onChange={setValue}
|
||||||
/>
|
selectedTab={selectedTab}
|
||||||
</div>
|
onTabChange={setSelectedTab}
|
||||||
)
|
generateMarkdownPreview={(markdown) =>
|
||||||
|
Promise.resolve(<ReactMarkdown source={markdown} />)}
|
||||||
|
/>
|
||||||
|
<button onClick={submitPost}>Submit Post</button>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NewPost;
|
export default NewPost;
|
||||||
|
|
Reference in a new issue