From 06955a0e37f820dff28d5add5cdac1fe6e780b08 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 8 Sep 2020 22:31:18 -0500 Subject: [PATCH] Making communities in PostForm optional. Fixing private-message. --- src/shared/components/post-form.tsx | 2 +- src/shared/components/post-listing.tsx | 3 -- src/shared/components/post-listings.tsx | 1 - src/shared/components/post.tsx | 1 - src/shared/components/private-message.tsx | 34 ++++++++++------------- src/shared/components/search.tsx | 2 -- src/shared/components/user-details.tsx | 2 -- 7 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/shared/components/post-form.tsx b/src/shared/components/post-form.tsx index f37b5bc..dd5d549 100644 --- a/src/shared/components/post-form.tsx +++ b/src/shared/components/post-form.tsx @@ -46,7 +46,7 @@ const MAX_POST_TITLE_LENGTH = 200; interface PostFormProps { post?: Post; // If a post is given, that means this is an edit - communities: Community[]; + communities?: Community[]; params?: PostFormParams; onCancel?(): any; onCreate?(id: number): any; diff --git a/src/shared/components/post-listing.tsx b/src/shared/components/post-listing.tsx index ade3740..23eed73 100644 --- a/src/shared/components/post-listing.tsx +++ b/src/shared/components/post-listing.tsx @@ -17,7 +17,6 @@ import { AddAdminForm, TransferSiteForm, TransferCommunityForm, - Community, } from 'lemmy-js-client'; import { BanType } from '../interfaces'; import { MomentTime } from './moment-time'; @@ -62,7 +61,6 @@ interface PostListingState { interface PostListingProps { post: Post; - communities: Community[]; // TODO this should be an optional showCommunity?: boolean; showBody?: boolean; moderators?: CommunityUser[]; @@ -129,7 +127,6 @@ export class PostListing extends Component { onCancel={this.handleEditCancel} enableNsfw={this.props.enableNsfw} enableDownvotes={this.props.enableDownvotes} - communities={this.props.communities} /> )} diff --git a/src/shared/components/post-listings.tsx b/src/shared/components/post-listings.tsx index 4f1f586..47aab75 100644 --- a/src/shared/components/post-listings.tsx +++ b/src/shared/components/post-listings.tsx @@ -27,7 +27,6 @@ export class PostListings extends Component { this.outer().map(post => ( <> {
{this.state.showEdit && ( {this.state.showReply && ( )} diff --git a/src/shared/components/search.tsx b/src/shared/components/search.tsx index e086a92..b032d45 100644 --- a/src/shared/components/search.tsx +++ b/src/shared/components/search.tsx @@ -297,7 +297,6 @@ export class Search extends Component {
{i.type_ == 'posts' && ( {
{
{i.type === 'posts' ? ( { {this.props.userRes.posts.map(post => ( <>