From: Dessalines Date: Wed, 9 Sep 2020 03:31:18 +0000 (-0500) Subject: Making communities in PostForm optional. Fixing private-message. X-Git-Url: http://these/git/readmes/%7Bthis.props.banner%7D?a=commitdiff_plain;h=06955a0e37f820dff28d5add5cdac1fe6e780b08;p=lemmy-ui.git Making communities in PostForm optional. Fixing private-message. --- 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 => ( <>