From d8ad0c38eaf06d7bc35b23367d5ac8f007f3d550 Mon Sep 17 00:00:00 2001 From: picklesrus Date: Thu, 17 Dec 2020 15:43:07 -0500 Subject: [PATCH] Show warning message when user has been muted several times. --- src/components/modal/mute/modal.jsx | 24 ++++++++++++- src/l10n.json | 3 ++ src/views/preview/comment/compose-comment.jsx | 14 +++++--- test/unit/components/compose-comment.test.jsx | 36 ++++++++++++++++++- test/unit/components/mute-modal.test.jsx | 14 ++++++++ 5 files changed, 85 insertions(+), 6 deletions(-) diff --git a/src/components/modal/mute/modal.jsx b/src/components/modal/mute/modal.jsx index 2a4f34397..00a25ee74 100644 --- a/src/components/modal/mute/modal.jsx +++ b/src/components/modal/mute/modal.jsx @@ -20,6 +20,10 @@ class MuteModal extends React.Component { 'handleNext', 'handlePrevious' ]); + this.numSteps = 2; + if (this.props.showWarning) { + this.numSteps++; + } this.state = { step: 0 }; @@ -82,6 +86,23 @@ class MuteModal extends React.Component { />

+ {this.props.showWarning ? ( + +

+ + + + )}} + /> +

+
) : null} @@ -97,7 +118,7 @@ class MuteModal extends React.Component { ) : null } - {this.state.step >= 1 ? ( + {this.state.step >= this.numSteps - 1 ? (