From 954c89edaf1bcc5dc46c3b593bf8b065f0db74a9 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 22 Aug 2019 11:46:54 -0700 Subject: [PATCH] cross-posting almost done. --- ui/src/components/post-listing.tsx | 14 ++++++++++++++ ui/src/translations/en.ts | 1 + 2 files changed, 15 insertions(+) diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index bb6f2cec..f67a0fc7 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -150,6 +150,9 @@ export class PostListing extends Component {
  • {post.saved ? i18n.t('unsave') : i18n.t('save')}
  • +
  • + # +
  • {this.myPost && <>
  • @@ -270,6 +273,17 @@ export class PostListing extends Component { 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}`; + } + if (i.props.post.body) { + params += `&body=${i.props.post.body}`; + } + i.context.router.history.push(`/create_post${params}`); + } + handleModRemoveShow(i: PostListing) { i.state.showRemoveDialog = true; i.setState(i.state); diff --git a/ui/src/translations/en.ts b/ui/src/translations/en.ts index 90497ada..94e06d02 100644 --- a/ui/src/translations/en.ts +++ b/ui/src/translations/en.ts @@ -9,6 +9,7 @@ export const en = { posts: 'Posts', related_posts: 'These posts might be related', cross_posts: 'This link has also been posted to:', + cross_post: 'cross-post', comments: 'Comments', number_of_comments:'{{count}} Comments', remove_comment: 'Remove Comment', -- 2.44.1