From 14adffba37ac3a157c3d1f725da299ff5c5014b1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 24 Aug 2021 17:23:33 -0500 Subject: [PATCH] Display "Replying to {acct}" instead of "Show thread" --- app/soapbox/components/status.js | 42 ++++++++++++++++++++++++++----- app/styles/components/status.scss | 20 +++------------ 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/app/soapbox/components/status.js b/app/soapbox/components/status.js index 151a3e926..999a44129 100644 --- a/app/soapbox/components/status.js +++ b/app/soapbox/components/status.js @@ -193,6 +193,12 @@ class Status extends ImmutablePureComponent { this.props.onToggleHidden(this._properStatus()); }; + handleReplyToClick = ({ target }) => { + if (target.className === 'status__meta') { + this.handleClick(); + } + } + renderLoadingMediaGallery() { return
; } @@ -290,6 +296,29 @@ class Status extends ImmutablePureComponent { this.node = c; } + getInReplyToMessage = () => { + const { status } = this.props; + const inReplyToId = status.get('in_reply_to_id'); + const inReplyToAcct = status.getIn(['pleroma', 'in_reply_to_account_acct']); + + if (inReplyToAcct) { + return ( + {`@${inReplyToAcct.split('@')[0]}`} }} + /> + ); + } + + // Fallback for Mastodon + if (inReplyToId) { + return ; + } + + return null; + } + render() { let media = null; const poll = null; @@ -467,6 +496,7 @@ class Status extends ImmutablePureComponent { const statusUrl = `/@${status.getIn(['account', 'acct'])}/posts/${status.get('id')}`; const favicon = status.getIn(['account', 'pleroma', 'favicon']); const domain = getDomain(status.get('account')); + const inReplyToMessage = this.getInReplyToMessage(); return ( @@ -507,6 +537,12 @@ class Status extends ImmutablePureComponent {
)} + {(showThread && inReplyToMessage) && ( + + )} + - - - )} -