Add setting to manage visibility of vote count, vote button and decide root page (#197)

This commit is contained in:
Riccardo Graziosi
2023-02-05 11:55:38 +01:00
committed by GitHub
parent d4242dd78e
commit e7335f5622
35 changed files with 246 additions and 48 deletions

View File

@@ -7,6 +7,7 @@ import PostList from './PostList';
import Sidebar from '../common/Sidebar';
import IBoard from '../../interfaces/IBoard';
import ITenantSetting from '../../interfaces/ITenantSetting';
import { PostsState } from '../../reducers/postsReducer';
import { PostStatusesState } from '../../reducers/postStatusesReducer';
@@ -14,6 +15,8 @@ import { PostStatusesState } from '../../reducers/postStatusesReducer';
interface Props {
board: IBoard;
isLoggedIn: boolean;
isPowerUser: boolean;
tenantSetting: ITenantSetting;
authenticityToken: string;
posts: PostsState;
postStatuses: PostStatusesState;
@@ -63,6 +66,8 @@ class BoardP extends React.Component<Props> {
const {
board,
isLoggedIn,
isPowerUser,
tenantSetting,
authenticityToken,
posts,
postStatuses,
@@ -97,6 +102,8 @@ class BoardP extends React.Component<Props> {
<PostList
posts={posts.items}
showLikeCount={isPowerUser || tenantSetting.show_vote_count}
showLikeButtons={tenantSetting.show_vote_button_in_board}
postStatuses={postStatuses.items}
areLoading={posts.areLoading}
error={posts.error}