File tree Expand file tree Collapse file tree
zendesk_app/src/app/components/RightPanelApp
components/IterationTextbox Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ export const RightPanelApp = (): JSX.Element => {
130130 setValue = { setIterationRequest }
131131 onSubmit = { ( ) => void handleSubmitTask ( 'iterate' ) } // Utilise la nouvelle fonction
132132 hasDraftResponse = { ! ! response }
133+ ongoingTask = { ongoingTask }
133134 > </ IterationTextbox >
134135 </ div >
135136 ) }
Original file line number Diff line number Diff line change 3737 }
3838 }
3939
40- .icon {
40+ .submit_button {
4141 cursor : pointer ;
4242 display : flex ;
43+ background-color : transparent ;
44+ border : none ;
45+ outline : none ;
46+
47+ & :disabled {
48+ cursor : default ;
49+ }
4350 }
4451 }
4552}
Original file line number Diff line number Diff line change @@ -8,21 +8,26 @@ interface IterationTextboxProps {
88 hasDraftResponse : boolean
99 setValue : ( value : string ) => void
1010 onSubmit : ( ) => void
11+ ongoingTask : boolean
1112}
1213
1314export const IterationTextbox = ( {
1415 value,
1516 setValue,
1617 onSubmit,
17- hasDraftResponse
18+ hasDraftResponse,
19+ ongoingTask
1820} : IterationTextboxProps ) : JSX . Element => {
1921 const textareaRef = useRef < HTMLTextAreaElement > ( null )
2022
2123 const handleKeyDown = ( e : React . KeyboardEvent < HTMLTextAreaElement > ) => {
2224 if ( e . key === 'Enter' && ! e . shiftKey ) {
2325 e . preventDefault ( )
24- onSubmit ( )
25- setValue ( '' )
26+
27+ if ( ! ongoingTask ) {
28+ onSubmit ( )
29+ setValue ( '' )
30+ }
2631 }
2732 }
2833
@@ -53,9 +58,9 @@ export const IterationTextbox = ({
5358 onKeyDown = { handleKeyDown }
5459 rows = { 1 }
5560 />
56- < div className = { styles . icon } onClick = { onSubmit } >
57- < Icon name = "send" size = "normal" color = "accent" disabled = { ! value } />
58- </ div >
61+ < button className = { styles . submit_button } onClick = { onSubmit } disabled = { ongoingTask || ! value } >
62+ < Icon name = "send" size = "normal" color = "accent" disabled = { ongoingTask || ! value } />
63+ </ button >
5964 </ div >
6065 </ div >
6166 )
You can’t perform that action at this time.
0 commit comments