summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-04-04 13:53:32 -0700
committerDessalines <tyhou13@gmx.com>2019-04-04 13:53:32 -0700
commitf3cbe9e6cee4a03d8677414ae29b81a59d31b71c (patch)
treee55c24133e335fd55be926e49d4d500fc019e93b /ui/src/components/post.tsx
parentd07a1b4563b829232040c9b1156a6598f493f469 (diff)
Getting community moderators
- Getting back mods with a fetch. Fixes #28
Diffstat (limited to 'ui/src/components/post.tsx')
-rw-r--r--ui/src/components/post.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx
index 457b286e..f36ad979 100644
--- a/ui/src/components/post.tsx
+++ b/ui/src/components/post.tsx
@@ -2,7 +2,7 @@ import { Component, linkEvent } from 'inferno';
import { Link } from 'inferno-router';
import { Subscription } from "rxjs";
import { retryWhen, delay, take } from 'rxjs/operators';
-import { UserOperation, Community, Post as PostI, GetPostResponse, PostResponse, Comment, CommentForm as CommentFormI, CommentResponse, CommentLikeForm, CommentSortType, CreatePostLikeResponse } from '../interfaces';
+import { UserOperation, Community, Post as PostI, GetPostResponse, PostResponse, Comment, CommentForm as CommentFormI, CommentResponse, CommentLikeForm, CommentSortType, CreatePostLikeResponse, CommunityUser } from '../interfaces';
import { WebSocketService, UserService } from '../services';
import { msgOp, hotRank,mdToHtml } from '../utils';
import { MomentTime } from './moment-time';
@@ -20,6 +20,7 @@ interface PostState {
comments: Array<Comment>;
commentSort: CommentSortType;
community: Community;
+ moderators: Array<CommunityUser>;
}
export class Post extends Component<any, PostState> {
@@ -30,6 +31,7 @@ export class Post extends Component<any, PostState> {
comments: [],
commentSort: CommentSortType.Hot,
community: null,
+ moderators: []
}
constructor(props, context) {
@@ -118,7 +120,7 @@ export class Post extends Component<any, PostState> {
sidebar() {
return (
<div class="sticky-top">
- <Sidebar community={this.state.community} />
+ <Sidebar community={this.state.community} moderators={this.state.moderators} />
</div>
);
}
@@ -188,6 +190,7 @@ export class Post extends Component<any, PostState> {
this.state.post = res.post;
this.state.comments = res.comments;
this.state.community = res.community;
+ this.state.moderators = res.moderators;
this.setState(this.state);
} else if (op == UserOperation.CreateComment) {
let res: CommentResponse = msg;