File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const tooltips = [
3030const propTypes = {
3131 comment : PropTypes . string ,
3232 commentRequired : PropTypes . bool ,
33+ iconRequired : PropTypes . bool ,
3334 score : PropTypes . number ,
3435 setComment : PropTypes . func ,
3536 setScore : PropTypes . func ,
@@ -38,6 +39,7 @@ const propTypes = {
3839const Pulse = ( {
3940 comment,
4041 commentRequired,
42+ iconRequired,
4143 score,
4244 setComment,
4345 setScore,
@@ -46,7 +48,7 @@ const Pulse = ({
4648 < div className = "pulse" >
4749 < div className = "title-row" >
4850 < Typography variant = "h6" > { title } </ Typography >
49- { commentRequired && < Typography variant = "h6" color = "red" > *</ Typography > }
51+ { iconRequired && < Typography variant = "h6" color = "red" > *</ Typography > }
5052 </ div >
5153 < div className = "icon-row" >
5254 { icons . map ( ( sentiment , index ) => (
@@ -55,7 +57,7 @@ const Pulse = ({
5557 aria-label = "sentiment"
5658 className = { index === score ? 'selected' : '' }
5759 data-testid = { `score-button-${ index } ` }
58- onClick = { ( ) => setScore ( index ) }
60+ onClick = { ( ) => setScore ( score == index ? null : index ) }
5961 sx = { { color : colors [ index ] } }
6062 >
6163 { sentiment }
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ const PulsePage = () => {
120120 < Pulse
121121 key = "pulse-internal"
122122 comment = { internalComment }
123- commentRequired = { true }
123+ iconRequired = { true }
124124 score = { internalScore }
125125 setComment = { setInternalComment }
126126 setScore = { setInternalScore }
@@ -138,6 +138,7 @@ const PulsePage = () => {
138138 < Button
139139 style = { { marginTop : 0 } }
140140 onClick = { submit }
141+ disabled = { internalScore == null }
141142 variant = "contained" >
142143 Submit
143144 </ Button >
You can’t perform that action at this time.
0 commit comments