1
0
Fork 0

Compare commits

..

2 commits

Author SHA1 Message Date
5a057337cd test out react-mde 2019-10-19 15:47:12 -04:00
c99e40c5d7 Clean up dependencies 2019-10-19 15:46:39 -04:00
5 changed files with 3142 additions and 2464 deletions

5559
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,15 +6,16 @@
"axios": "^0.18.1",
"github-markdown-css": "^3.0.1",
"react": "^16.10.2",
"react-cookie": "^4.0.1",
"react-dom": "^16.10.2",
"react-markdown": "^4.2.2",
"react-mde": "^7.6.2",
"react-redux": "^7.1.1",
"react-router-dom": "^5.1.2",
"react-scripts": "3.0.0",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0",
"semantic-ui-react": "^0.87.3"
"semantic-ui-react": "^0.87.3",
"universal-cookie": "^4.0.2"
},
"scripts": {
"start": "react-scripts start",

View file

@ -6,6 +6,7 @@ import PostList from './PostList';
import Post from './Post';
import User from './User';
import About from './About'
import NewPost from './NewPost'
function App() {
return (
@ -18,6 +19,7 @@ function App() {
<Route exact path="/posts/" component={PostList}/>
<Route path="/posts/:slug" component={Post}/>
<Route path="/users/:user" component={User}/>
<Route path="/newpost/" component={NewPost}/>
</Switch>
</Router>
<Footer/>

View file

@ -190,7 +190,7 @@ class AuthMenu extends Component {
<div className="ui menu dropdown" style={{display: "inline"}}>
<div className="ui left icon input">
<i className="edit icon"></i>
<button onClick={this.handleMakePost} className="fluid ui positive button">Create Post!</button>
<button onClick={() => { document.location.href = "newpost"; }} className="fluid ui positive button">Create Post!</button>
</div>
</div>
)

36
src/components/NewPost.js Normal file
View file

@ -0,0 +1,36 @@
import React from 'react';
import ReactMde from "react-mde";
import ReactMarkdown from 'react-markdown';
import 'github-markdown-css'
class NewPost extends React.Component {
constructor (props) {
super(props)
this.state = {
title: '',
content: ''
}
}
handleChange = value => {
this.setState({ mdeValue: value });
};
render () {
return(
<div className="container">
<ReactMde
value={this.state.content}
/*
onChange={setValue}
selectedTab={selectedTab}
onTabChange={setSelectedTab}
*/
generateMarkdownPreview={(markdown) => <ReactMarkdown source={markdown} />}
/>
</div>
)
}
}
export default NewPost;