From ac943f8951fe7da86aaa9f41ee879ab670786c86 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 2 Feb 2020 13:50:44 -0500 Subject: Finishing up interpolation rework. --- ui/src/components/search.tsx | 45 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) (limited to 'ui/src/components/search.tsx') diff --git a/ui/src/components/search.tsx b/ui/src/components/search.tsx index e3789d5a..3acb7167 100644 --- a/ui/src/components/search.tsx +++ b/ui/src/components/search.tsx @@ -12,7 +12,7 @@ import { SearchForm, SearchResponse, SearchType, - CreatePostLikeResponse, + PostResponse, CommentResponse, WebSocketJsonResponse, } from '../interfaces'; @@ -30,7 +30,6 @@ import { PostListing } from './post-listing'; import { SortSelect } from './sort-select'; import { CommentNodes } from './comment-nodes'; import { i18n } from '../i18next'; -import { T } from 'inferno-i18next'; interface SearchState { q: string; @@ -126,9 +125,7 @@ export class Search extends Component { render() { return (
-
- { i18n.t('search') } -
+
{i18n.t('search')}
{this.selects()} {this.searchForm()} {this.state.type_ == SearchType.All && this.all()} @@ -163,9 +160,7 @@ export class Search extends Component { ) : ( - - { i18n.t('search') } - + {i18n.t('search')} )} @@ -180,24 +175,14 @@ export class Search extends Component { onChange={linkEvent(this, this.handleTypeChange)} class="custom-select custom-select-sm w-auto" > - - - - + + + + - + { class="btn btn-sm btn-secondary mr-1" onClick={linkEvent(this, this.prevPage)} > - { i18n.t('prev') } + {i18n.t('prev')} )}
); @@ -404,11 +389,7 @@ export class Search extends Component { res.posts.length == 0 && res.comments.length == 0 && res.communities.length == 0 && - res.users.length == 0 && ( - - { i18n.t('no_results') } - - )} + res.users.length == 0 && {i18n.t('no_results')}} ); } @@ -506,7 +487,7 @@ export class Search extends Component { } this.setState(this.state); } else if (res.op == UserOperation.CreatePostLike) { - let data = res.data as CreatePostLikeResponse; + let data = res.data as PostResponse; let found = this.state.searchResponse.posts.find( c => c.id == data.post.id ); -- cgit v1.2.3