summaryrefslogtreecommitdiffstats
path: root/ui/src/components/community.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-04-21 13:52:55 -0700
committerDessalines <tyhou13@gmx.com>2019-04-21 13:52:55 -0700
commit016920aeb7dc47f32412829c70b872c54caf10e3 (patch)
tree4bb62c262bec180514fa7631a9b2416046c76edb /ui/src/components/community.tsx
parent273a38f61f03b4e1316ff2a0a75607dc77aaaf44 (diff)
Community moderation fixes.
- Don't show banned communities on main post list. Fixes #95 - Add back in community moderation and editing. Fixes #92
Diffstat (limited to 'ui/src/components/community.tsx')
-rw-r--r--ui/src/components/community.tsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx
index 6271bde5..c89d2f06 100644
--- a/ui/src/components/community.tsx
+++ b/ui/src/components/community.tsx
@@ -1,7 +1,7 @@
import { Component } from 'inferno';
import { Subscription } from "rxjs";
import { retryWhen, delay, take } from 'rxjs/operators';
-import { UserOperation, Community as CommunityI, GetCommunityResponse, CommunityResponse, CommunityUser} from '../interfaces';
+import { UserOperation, Community as CommunityI, GetCommunityResponse, CommunityResponse, CommunityUser, UserView } from '../interfaces';
import { WebSocketService } from '../services';
import { PostListings } from './post-listings';
import { Sidebar } from './sidebar';
@@ -11,6 +11,7 @@ interface State {
community: CommunityI;
communityId: number;
moderators: Array<CommunityUser>;
+ admins: Array<UserView>;
loading: boolean;
}
@@ -29,9 +30,11 @@ export class Community extends Component<any, State> {
number_of_subscribers: null,
number_of_posts: null,
number_of_comments: null,
- published: null
+ published: null,
+ removed: null,
},
moderators: [],
+ admins: [],
communityId: Number(this.props.match.params.id),
loading: true
}
@@ -71,7 +74,11 @@ export class Community extends Component<any, State> {
<PostListings communityId={this.state.communityId} />
</div>
<div class="col-12 col-md-3">
- <Sidebar community={this.state.community} moderators={this.state.moderators} />
+ <Sidebar
+ community={this.state.community}
+ moderators={this.state.moderators}
+ admins={this.state.admins}
+ />
</div>
</div>
}
@@ -90,6 +97,7 @@ export class Community extends Component<any, State> {
let res: GetCommunityResponse = msg;
this.state.community = res.community;
this.state.moderators = res.moderators;
+ this.state.admins = res.admins;
this.state.loading = false;
this.setState(this.state);
} else if (op == UserOperation.EditCommunity) {