Files
astuto/app/javascript/components/Post/index.tsx

68 lines
1.5 KiB
TypeScript
Raw Normal View History

2019-09-12 15:51:45 +02:00
import * as React from 'react';
import { Provider } from 'react-redux';
import createStoreHelper from '../../helpers/createStore';
2019-09-12 15:51:45 +02:00
import Post from '../../containers/Post';
2019-09-21 12:54:57 +02:00
import IBoard from '../../interfaces/IBoard';
import IPostStatus from '../../interfaces/IPostStatus';
2019-09-26 16:03:41 +02:00
import { Store } from 'redux';
import { State } from '../../reducers/rootReducer';
import ITenantSetting from '../../interfaces/ITenantSetting';
2019-09-26 16:03:41 +02:00
interface Props {
postId: number;
2019-09-21 12:54:57 +02:00
boards: Array<IBoard>;
postStatuses: Array<IPostStatus>;
isLoggedIn: boolean;
isPowerUser: boolean;
currentUserFullName: string;
currentUserEmail: string;
tenantSetting: ITenantSetting;
authenticityToken: string;
}
class PostRoot extends React.Component<Props> {
2019-09-26 16:03:41 +02:00
store: Store<State, any>;
constructor(props: Props) {
super(props);
this.store = createStoreHelper();
}
render() {
const {
postId,
2019-09-21 12:54:57 +02:00
boards,
postStatuses,
isLoggedIn,
isPowerUser,
currentUserFullName,
currentUserEmail,
tenantSetting,
authenticityToken
} = this.props;
return (
<Provider store={this.store}>
<Post
postId={postId}
2019-09-21 12:54:57 +02:00
boards={boards}
postStatuses={postStatuses}
isLoggedIn={isLoggedIn}
isPowerUser={isPowerUser}
currentUserFullName={currentUserFullName}
currentUserEmail={currentUserEmail}
tenantSetting={tenantSetting}
authenticityToken={authenticityToken}
/>
</Provider>
);
}
}
2019-09-12 15:51:45 +02:00
export default PostRoot;