From: Dessalines Date: Mon, 29 Jul 2019 01:57:09 +0000 (-0700) Subject: Adding similar post searching before creating post. X-Git-Url: http://these/git/%7B%60https:/%7B%60css/themes/%22https:/nerdica.net/%7Bpost.url%7D?a=commitdiff_plain;h=e27ca774cdf86804ba7e3dca48b50dd15969bdae;p=lemmy.git Adding similar post searching before creating post. - Fixes #185. - Offsetting create post and community columns. --- diff --git a/ui/src/components/create-community.tsx b/ui/src/components/create-community.tsx index 5e31efc2..c2f89eef 100644 --- a/ui/src/components/create-community.tsx +++ b/ui/src/components/create-community.tsx @@ -18,7 +18,7 @@ export class CreateCommunity extends Component { return (
-
+
Create Community
diff --git a/ui/src/components/create-post.tsx b/ui/src/components/create-post.tsx index 0e37ba1d..e09bcf70 100644 --- a/ui/src/components/create-post.tsx +++ b/ui/src/components/create-post.tsx @@ -17,7 +17,7 @@ export class CreatePost extends Component { return (
-
+
Create a Post
diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx index 50b4acd1..9b33c6e1 100644 --- a/ui/src/components/post-form.tsx +++ b/ui/src/components/post-form.tsx @@ -1,7 +1,8 @@ import { Component, linkEvent } from 'inferno'; +import { PostListings } from './post-listings'; import { Subscription } from "rxjs"; import { retryWhen, delay, take } from 'rxjs/operators'; -import { PostForm as PostFormI, Post, PostResponse, UserOperation, Community, ListCommunitiesResponse, ListCommunitiesForm, SortType } from '../interfaces'; +import { PostForm as PostFormI, Post, PostResponse, UserOperation, Community, ListCommunitiesResponse, ListCommunitiesForm, SortType, SearchForm, SearchType, SearchResponse } from '../interfaces'; import { WebSocketService, UserService } from '../services'; import { msgOp, getPageTitle } from '../utils'; import * as autosize from 'autosize'; @@ -19,6 +20,7 @@ interface PostFormState { communities: Array; loading: boolean; suggestedTitle: string; + suggestedPosts: Array; } export class PostForm extends Component { @@ -34,6 +36,7 @@ export class PostForm extends Component { communities: [], loading: false, suggestedTitle: undefined, + suggestedPosts: [], } constructor(props: any, context: any) { @@ -86,7 +89,7 @@ export class PostForm extends Component {
{this.state.suggestedTitle && - copy suggested title: {this.state.suggestedTitle} +
copy suggested title: {this.state.suggestedTitle}
}
@@ -94,6 +97,12 @@ export class PostForm extends Component {