2019-09-12 15:51:45 +02:00
|
|
|
import * as React from 'react';
|
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
|
2019-09-14 12:42:30 +02:00
|
|
|
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';
|
2019-09-14 12:42:30 +02:00
|
|
|
import IPostStatus from '../../interfaces/IPostStatus';
|
|
|
|
|
|
2019-09-26 16:03:41 +02:00
|
|
|
import { Store } from 'redux';
|
|
|
|
|
import { State } from '../../reducers/rootReducer';
|
2023-02-05 11:55:38 +01:00
|
|
|
import ITenantSetting from '../../interfaces/ITenantSetting';
|
2019-09-26 16:03:41 +02:00
|
|
|
|
2019-09-14 12:42:30 +02:00
|
|
|
interface Props {
|
|
|
|
|
postId: number;
|
2019-09-21 12:54:57 +02:00
|
|
|
boards: Array<IBoard>;
|
2019-09-14 12:42:30 +02:00
|
|
|
postStatuses: Array<IPostStatus>;
|
|
|
|
|
isLoggedIn: boolean;
|
|
|
|
|
isPowerUser: boolean;
|
2022-06-22 10:17:42 +02:00
|
|
|
currentUserFullName: string;
|
|
|
|
|
currentUserEmail: string;
|
2023-02-05 11:55:38 +01:00
|
|
|
tenantSetting: ITenantSetting;
|
2019-09-14 12:42:30 +02:00
|
|
|
authenticityToken: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class PostRoot extends React.Component<Props> {
|
2019-09-26 16:03:41 +02:00
|
|
|
store: Store<State, any>;
|
2019-09-14 12:42:30 +02:00
|
|
|
|
2019-09-26 11:00:32 +02:00
|
|
|
constructor(props: Props) {
|
2019-09-14 12:42:30 +02:00
|
|
|
super(props);
|
|
|
|
|
|
|
|
|
|
this.store = createStoreHelper();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const {
|
|
|
|
|
postId,
|
2019-09-21 12:54:57 +02:00
|
|
|
boards,
|
2019-09-14 12:42:30 +02:00
|
|
|
postStatuses,
|
|
|
|
|
isLoggedIn,
|
|
|
|
|
isPowerUser,
|
2022-06-22 10:17:42 +02:00
|
|
|
currentUserFullName,
|
|
|
|
|
currentUserEmail,
|
2023-02-05 11:55:38 +01:00
|
|
|
tenantSetting,
|
2019-09-14 12:42:30 +02:00
|
|
|
authenticityToken
|
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Provider store={this.store}>
|
|
|
|
|
<Post
|
|
|
|
|
postId={postId}
|
2019-09-21 12:54:57 +02:00
|
|
|
boards={boards}
|
2019-09-14 12:42:30 +02:00
|
|
|
postStatuses={postStatuses}
|
|
|
|
|
|
|
|
|
|
isLoggedIn={isLoggedIn}
|
|
|
|
|
isPowerUser={isPowerUser}
|
2022-06-22 10:17:42 +02:00
|
|
|
currentUserFullName={currentUserFullName}
|
|
|
|
|
currentUserEmail={currentUserEmail}
|
2023-02-05 11:55:38 +01:00
|
|
|
tenantSetting={tenantSetting}
|
2019-09-14 12:42:30 +02:00
|
|
|
authenticityToken={authenticityToken}
|
|
|
|
|
/>
|
|
|
|
|
</Provider>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-12 15:51:45 +02:00
|
|
|
|
|
|
|
|
export default PostRoot;
|