From 5ee2b860f902871c1f38ae0e9b8f333b38c73bbe Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 26 Oct 2020 20:03:33 +0100 Subject: [PATCH] Respect glitch-soc's reply counter setting in the pop-in player --- .../picture_in_picture/components/footer.js | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js index 75bd39dead..2ddba140e2 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js +++ b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js @@ -30,6 +30,7 @@ const makeMapStateToProps = () => { const mapStateToProps = (state, { statusId }) => ({ status: getStatus(state, { id: statusId }), askReplyConfirmation: state.getIn(['compose', 'text']).trim().length !== 0, + showReplyCount: state.getIn(['local_settings', 'show_reply_count']), }); return mapStateToProps; @@ -49,6 +50,7 @@ class Footer extends ImmutablePureComponent { intl: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, askReplyConfirmation: PropTypes.bool, + showReplyCount: PropTypes.bool, }; _performReply = () => { @@ -98,7 +100,7 @@ class Footer extends ImmutablePureComponent { }; render () { - const { status, intl } = this.props; + const { status, intl, showReplyCount } = this.props; const publicStatus = ['public', 'unlisted'].includes(status.get('visibility')); const reblogPrivate = status.getIn(['account', 'id']) === me && status.get('visibility') === 'private'; @@ -125,9 +127,32 @@ class Footer extends ImmutablePureComponent { reblogTitle = intl.formatMessage(messages.cannot_reblog); } + let replyButton = null; + if (showReplyCount) { + replyButton = ( + + ); + } else { + replyButton = ( + + ); + } + return (
- + {replyButton}