Files
astuto/app/javascript/components/Post/index.tsx
Riccardo Graziosi dad382d2b1 Post follow and updates notifications V1 (#111)
* It is now possible to follow a post in order to receive updates about it
* Notifications are now sent when updates are published
* Post status changes are now tracked
* Update sidebar now shows the post status history
* Mark a comment as a post update using the comment form
* ... more ...
2022-05-28 11:03:36 +02:00

64 lines
1.3 KiB
TypeScript

import * as React from 'react';
import { Provider } from 'react-redux';
import createStoreHelper from '../../helpers/createStore';
import Post from '../../containers/Post';
import IBoard from '../../interfaces/IBoard';
import IPostStatus from '../../interfaces/IPostStatus';
import { Store } from 'redux';
import { State } from '../../reducers/rootReducer';
interface Props {
postId: number;
boards: Array<IBoard>;
postStatuses: Array<IPostStatus>;
isLoggedIn: boolean;
isPowerUser: boolean;
userFullName: string;
userEmail: string;
authenticityToken: string;
}
class PostRoot extends React.Component<Props> {
store: Store<State, any>;
constructor(props: Props) {
super(props);
this.store = createStoreHelper();
}
render() {
const {
postId,
boards,
postStatuses,
isLoggedIn,
isPowerUser,
userFullName,
userEmail,
authenticityToken
} = this.props;
return (
<Provider store={this.store}>
<Post
postId={postId}
boards={boards}
postStatuses={postStatuses}
isLoggedIn={isLoggedIn}
isPowerUser={isPowerUser}
userFullName={userFullName}
userEmail={userEmail}
authenticityToken={authenticityToken}
/>
</Provider>
);
}
}
export default PostRoot;