summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post-listing.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/components/post-listing.tsx')
-rw-r--r--ui/src/components/post-listing.tsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx
index f67a0fc7..f6bf80e4 100644
--- a/ui/src/components/post-listing.tsx
+++ b/ui/src/components/post-listing.tsx
@@ -151,7 +151,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<span class="pointer" onClick={linkEvent(this, this.handleSavePostClick)}>{post.saved ? i18n.t('unsave') : i18n.t('save')}</span>
</li>
<li className="list-inline-item mr-2">
- <span class="pointer" onClick={linkEvent(this, this.handleCrossPostClick)}><T i18nKey="cross_post">#</T></span>
+ <Link className="text-muted" to={`/create_post${this.crossPostParams}`}><T i18nKey="cross_post">#</T></Link>
</li>
{this.myPost &&
<>
@@ -273,15 +273,15 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
WebSocketService.Instance.savePost(form);
}
- handleCrossPostClick(i: PostListing) {
- let params = `?name=${i.props.post.name}`;
- if (i.props.post.url) {
- params += `&url=${i.props.post.url}`;
+ get crossPostParams(): string {
+ let params = `?name=${this.props.post.name}`;
+ if (this.props.post.url) {
+ params += `&url=${this.props.post.url}`;
}
- if (i.props.post.body) {
- params += `&body=${i.props.post.body}`;
+ if (this.props.post.body) {
+ params += `&body=${this.props.post.body}`;
}
- i.context.router.history.push(`/create_post${params}`);
+ return params;
}
handleModRemoveShow(i: PostListing) {