summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-05-17 18:39:15 -0400
committerDessalines <tyhou13@gmx.com>2020-05-17 18:39:15 -0400
commit99e4551cf67d3e71b903f0d7d60133b6158facde (patch)
treea048a3d24657b285a1087f12469f62e4fa7c63ea /ui/src/components/post.tsx
parentf5e96d9372565b5043664e9103ac9207e2c33840 (diff)
Simplify cross-posts. Fixes #727
Diffstat (limited to 'ui/src/components/post.tsx')
-rw-r--r--ui/src/components/post.tsx30
1 files changed, 13 insertions, 17 deletions
diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx
index de0f0e32..bf3694ba 100644
--- a/ui/src/components/post.tsx
+++ b/ui/src/components/post.tsx
@@ -40,7 +40,6 @@ import {
setupTippy,
} from '../utils';
import { PostListing } from './post-listing';
-import { PostListings } from './post-listings';
import { Sidebar } from './sidebar';
import { CommentForm } from './comment-form';
import { CommentNodes } from './comment-nodes';
@@ -183,14 +182,6 @@ export class Post extends Component<any, PostState> {
moderators={this.state.moderators}
admins={this.state.admins}
/>
- {this.state.crossPosts.length > 0 && (
- <>
- <div class="my-1 text-muted small font-weight-bold">
- {i18n.t('cross_posts')}
- </div>
- <PostListings showCommunity posts={this.state.crossPosts} />
- </>
- )}
<div className="mb-2" />
<CommentForm
postId={this.state.post.id}
@@ -213,8 +204,9 @@ export class Post extends Component<any, PostState> {
return (
<div class="btn-group btn-group-toggle mb-2">
<label
- className={`btn btn-sm btn-secondary pointer ${this.state
- .commentSort === CommentSortType.Hot && 'active'}`}
+ className={`btn btn-sm btn-secondary pointer ${
+ this.state.commentSort === CommentSortType.Hot && 'active'
+ }`}
>
{i18n.t('hot')}
<input
@@ -225,8 +217,9 @@ export class Post extends Component<any, PostState> {
/>
</label>
<label
- className={`btn btn-sm btn-secondary pointer ${this.state
- .commentSort === CommentSortType.Top && 'active'}`}
+ className={`btn btn-sm btn-secondary pointer ${
+ this.state.commentSort === CommentSortType.Top && 'active'
+ }`}
>
{i18n.t('top')}
<input
@@ -237,8 +230,9 @@ export class Post extends Component<any, PostState> {
/>
</label>
<label
- className={`btn btn-sm btn-secondary pointer ${this.state
- .commentSort === CommentSortType.New && 'active'}`}
+ className={`btn btn-sm btn-secondary pointer ${
+ this.state.commentSort === CommentSortType.New && 'active'
+ }`}
>
{i18n.t('new')}
<input
@@ -249,8 +243,9 @@ export class Post extends Component<any, PostState> {
/>
</label>
<label
- className={`btn btn-sm btn-secondary pointer ${this.state
- .commentSort === CommentSortType.Old && 'active'}`}
+ className={`btn btn-sm btn-secondary pointer ${
+ this.state.commentSort === CommentSortType.Old && 'active'
+ }`}
>
{i18n.t('old')}
<input
@@ -462,6 +457,7 @@ export class Post extends Component<any, PostState> {
this.state.crossPosts = data.posts.filter(
p => p.id != Number(this.props.match.params.id)
);
+ this.state.post.duplicates = this.state.crossPosts;
this.setState(this.state);
} else if (res.op == UserOperation.TransferSite) {
let data = res.data as GetSiteResponse;