From 47a3ecc30e61f0f8522b5f3fe306d30ff963d330 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 12 Nov 2021 12:28:58 -0600 Subject: [PATCH] ComposeModal: conditional title when replying --- .../features/ui/components/compose_modal.js | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/app/soapbox/features/ui/components/compose_modal.js b/app/soapbox/features/ui/components/compose_modal.js index 9b24f9429..658398626 100644 --- a/app/soapbox/features/ui/components/compose_modal.js +++ b/app/soapbox/features/ui/components/compose_modal.js @@ -20,6 +20,7 @@ const mapStateToProps = state => { account: state.getIn(['accounts', me]), composeText: state.getIn(['compose', 'text']), privacy: state.getIn(['compose', 'privacy']), + inReplyTo: state.getIn(['compose', 'in_reply_to']), }; }; @@ -31,6 +32,7 @@ class ComposeModal extends ImmutablePureComponent { onClose: PropTypes.func.isRequired, composeText: PropTypes.string, privacy: PropTypes.string, + inReplyTo: PropTypes.string, dispatch: PropTypes.func.isRequired, }; @@ -49,18 +51,26 @@ class ComposeModal extends ImmutablePureComponent { } }; + renderTitle = () => { + const { privacy, inReplyTo } = this.props; + + if (privacy === 'direct') { + return ; + } else if (inReplyTo) { + return ; + } else { + return ; + } + } + render() { - const { intl, privacy } = this.props; + const { intl } = this.props; return (

- {privacy === 'direct' ? ( - - ) : ( - - )} + {this.renderTitle()}