Draft: open mute modal from reply button if you're muted.

This commit is contained in:
picklesrus 2021-02-02 11:34:27 -05:00
parent f60a8c71a0
commit f7bf204924
3 changed files with 7 additions and 3 deletions

View file

@ -37,7 +37,7 @@ class MuteModal extends React.Component {
this.numSteps = this.props.showWarning ? steps.BAN_WARNING : steps.MUTE_INFO;
this.state = {
step: steps.COMMENT_ISSUE
step: this.props.startStep ? this.props.startStep : steps.COMMENT_ISSUE
};
}
handleNext () {
@ -240,6 +240,7 @@ MuteModal.propTypes = {
}),
onRequestClose: PropTypes.func,
showWarning: PropTypes.bool,
startStep: PropTypes.number,
timeMuted: PropTypes.string
};

View file

@ -231,6 +231,7 @@ class Comment extends React.Component {
{this.state.replying ? (
<FlexRow className="comment-reply-row">
<ComposeComment
isReply
commenteeId={author.id}
parentId={parentId || id}
projectId={projectId}

View file

@ -50,7 +50,7 @@ class ComposeComment extends React.Component {
status: ComposeStatus.EDITING,
error: null,
appealId: null,
muteOpen: false,
muteOpen: muteExpiresAtMs > Date.now() && this.props.isReply,
muteExpiresAtMs: muteExpiresAtMs,
muteType: this.props.muteStatus.currentMessageType,
showWarning: this.props.muteStatus.showWarning ? this.props.muteStatus.showWarning : false
@ -232,7 +232,7 @@ class ComposeComment extends React.Component {
render () {
return (
<React.Fragment>
{this.isMuted() ? (
{(this.isMuted() && !this.props.isReply) ? (
<FlexRow className="comment">
<CommentingStatus>
<p><FormattedMessage id={this.getMuteMessageInfo().commentType} /></p>
@ -344,6 +344,7 @@ class ComposeComment extends React.Component {
muteModalMessages={this.getMuteMessageInfo()}
shouldCloseOnOverlayClick={false}
showWarning={this.state.showWarning}
startStep={this.props.isReply ? 1 : 0}
timeMuted={formatTime.formatRelativeTime(this.state.muteExpiresAtMs, window._locale)}
onRequestClose={this.handleMuteClose}
/>
@ -355,6 +356,7 @@ class ComposeComment extends React.Component {
ComposeComment.propTypes = {
commenteeId: PropTypes.number,
isReply: PropTypes.bool,
muteStatus: PropTypes.shape({
offenses: PropTypes.array,
muteExpiresAt: PropTypes.number,