Compare commits
2 commits
9b6ac9acda
...
5a057337cd
Author | SHA1 | Date | |
---|---|---|---|
5a057337cd | |||
c99e40c5d7 |
5 changed files with 3142 additions and 2464 deletions
5561
package-lock.json
generated
5561
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -6,15 +6,16 @@
|
||||||
"axios": "^0.18.1",
|
"axios": "^0.18.1",
|
||||||
"github-markdown-css": "^3.0.1",
|
"github-markdown-css": "^3.0.1",
|
||||||
"react": "^16.10.2",
|
"react": "^16.10.2",
|
||||||
"react-cookie": "^4.0.1",
|
|
||||||
"react-dom": "^16.10.2",
|
"react-dom": "^16.10.2",
|
||||||
"react-markdown": "^4.2.2",
|
"react-markdown": "^4.2.2",
|
||||||
|
"react-mde": "^7.6.2",
|
||||||
"react-redux": "^7.1.1",
|
"react-redux": "^7.1.1",
|
||||||
"react-router-dom": "^5.1.2",
|
"react-router-dom": "^5.1.2",
|
||||||
"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"
|
"semantic-ui-react": "^0.87.3",
|
||||||
|
"universal-cookie": "^4.0.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
|
|
|
@ -6,6 +6,7 @@ import PostList from './PostList';
|
||||||
import Post from './Post';
|
import Post from './Post';
|
||||||
import User from './User';
|
import User from './User';
|
||||||
import About from './About'
|
import About from './About'
|
||||||
|
import NewPost from './NewPost'
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
|
@ -18,6 +19,7 @@ function App() {
|
||||||
<Route exact path="/posts/" component={PostList}/>
|
<Route exact path="/posts/" component={PostList}/>
|
||||||
<Route path="/posts/:slug" component={Post}/>
|
<Route path="/posts/:slug" component={Post}/>
|
||||||
<Route path="/users/:user" component={User}/>
|
<Route path="/users/:user" component={User}/>
|
||||||
|
<Route path="/newpost/" component={NewPost}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
</Router>
|
</Router>
|
||||||
<Footer/>
|
<Footer/>
|
||||||
|
|
|
@ -190,7 +190,7 @@ class AuthMenu extends Component {
|
||||||
<div className="ui menu dropdown" style={{display: "inline"}}>
|
<div className="ui menu dropdown" style={{display: "inline"}}>
|
||||||
<div className="ui left icon input">
|
<div className="ui left icon input">
|
||||||
<i className="edit icon"></i>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
36
src/components/NewPost.js
Normal file
36
src/components/NewPost.js
Normal 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;
|
Reference in a new issue