Add basic version of post show page

This commit is contained in:
riggraz
2019-09-12 15:51:45 +02:00
parent 5ca113b545
commit f599471af1
18 changed files with 330 additions and 11 deletions

View File

@@ -0,0 +1,27 @@
import { connect } from 'react-redux';
import { requestPost } from '../actions/requestPost';
import { changePostStatus } from '../actions/changePostStatus';
import { State } from '../reducers/rootReducer';
import PostP from '../components/Post/PostP';
const mapStateToProps = (state: State) => ({
post: state.currentPost,
});
const mapDispatchToProps = (dispatch) => ({
requestPost(postId: number) {
dispatch(requestPost(postId));
},
changePostStatus(postId: number, newPostStatusId: number, authenticityToken: string) {
dispatch(changePostStatus(postId, newPostStatusId, authenticityToken));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps,
)(PostP);