From e13ab2ee468924eb42d3a858f093e23b31d9cf8f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 14 Feb 2022 13:49:57 -0500 Subject: [PATCH] Add federated post and comment links. Fixes #569 (#575) --- .../components/comment/comment-node.tsx | 31 +++++++-- src/shared/components/common/symbols.tsx | 65 +++++++++++++++++++ src/shared/components/post/post-listing.tsx | 5 ++ 3 files changed, 94 insertions(+), 7 deletions(-) diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 1af8e11..d9702ba 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -1,3 +1,4 @@ +import classNames from "classnames"; import { Component, linkEvent } from "inferno"; import { Link } from "inferno-router"; import { @@ -849,14 +850,30 @@ export class CommentNode extends Component { linkBtn(small = false) { let cv = this.props.node.comment_view; + let classnames = classNames("btn btn-link btn-animate text-muted", { + "btn-sm": small, + }); + + let title = this.props.showContext + ? i18n.t("show_context") + : i18n.t("link"); + return ( - - - + <> + + + + {/* TODO comment ap_ids are currently broken anyway, so use post.ap_id, and wait until comment tree / endpoint refactor */} + {!cv.comment.local && ( + + + + )} + ); } diff --git a/src/shared/components/common/symbols.tsx b/src/shared/components/common/symbols.tsx index d730c15..03791d1 100644 --- a/src/shared/components/common/symbols.tsx +++ b/src/shared/components/common/symbols.tsx @@ -12,6 +12,71 @@ export const SYMBOLS = ( xmlnsXlink="http://www.w3.org/1999/xlink" > + + + + + + + + + + + + + + + + + + + + + diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 1608d41..9b07d1c 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -445,6 +445,11 @@ export class PostListing extends Component { /> )} + {!post.local && ( + + + + )} {post.removed && ( {i18n.t("removed")} -- 2.44.1