Fix hookup of newpost thanks markpassando
This commit is contained in:
parent
bc6dadb350
commit
bd20aecb06
1 changed files with 7 additions and 19 deletions
|
@ -2,35 +2,23 @@ import React from 'react';
|
||||||
import ReactMde from "react-mde";
|
import ReactMde from "react-mde";
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import 'github-markdown-css'
|
import 'github-markdown-css'
|
||||||
|
import "react-mde/lib/styles/css/react-mde-all.css"
|
||||||
|
|
||||||
class NewPost extends React.Component {
|
const NewPost = (props) => {
|
||||||
constructor (props) {
|
const [value, setValue] = React.useState("**Hello world!!!**");
|
||||||
super(props)
|
const [selectedTab, setSelectedTab] = React.useState("write");
|
||||||
this.state = {
|
|
||||||
title: '',
|
|
||||||
content: ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
handleChange = value => {
|
|
||||||
this.setState({ mdeValue: value });
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
render () {
|
|
||||||
return(
|
return(
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<ReactMde
|
<ReactMde
|
||||||
value={this.state.content}
|
value={value}
|
||||||
/*
|
|
||||||
onChange={setValue}
|
onChange={setValue}
|
||||||
selectedTab={selectedTab}
|
selectedTab={selectedTab}
|
||||||
onTabChange={setSelectedTab}
|
onTabChange={setSelectedTab}
|
||||||
*/
|
generateMarkdownPreview={(markdown) =>
|
||||||
generateMarkdownPreview={(markdown) => <ReactMarkdown source={markdown} />}
|
Promise.resolve(<ReactMarkdown source={markdown} />)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NewPost;
|
export default NewPost;
|
||||||
|
|
Reference in a new issue