@@ -33,6 +33,7 @@ function formatDate(value) {
3333export default function AssignmentCreatorForm ( {
3434 courses,
3535 handleSubmit,
36+ isAssignmentExportInProgress,
3637 parsedDate,
3738 onAssignAssignment,
3839 onDraftAssignment,
@@ -69,43 +70,61 @@ export default function AssignmentCreatorForm({
6970 valueLabel = { parsedDate }
7071 />
7172 </ div >
72- < button
73- className = { classnames (
74- 'assignment-creator__button' ,
75- 'assignment-creator__button_reject' ,
76- ) }
77- type = "button"
78- onClick = { onCloseAssignmentCreator }
79- >
80- { t ( 'assignment-creator.cancel-button' ) }
81- </ button >
82- < button
83- className = { classnames (
84- 'assignment-creator__button' ,
85- 'assignment-creator__button_confirm' ,
86- ) }
87- type = "button"
88- onClick = { handleSubmit ( onDraftAssignment ) }
89- >
90- { t ( 'assignment-creator.draft-button' ) }
91- </ button >
92- < button
93- className = { classnames (
94- 'assignment-creator__button' ,
95- 'assignment-creator__button_confirm' ,
96- ) }
97- type = "button"
98- onClick = { handleSubmit ( onAssignAssignment ) }
99- >
100- { t ( 'assignment-creator.assign-button' ) }
101- </ button >
73+ < div >
74+ {
75+ isAssignmentExportInProgress ?
76+ < button
77+ disabled
78+ className = { classnames (
79+ 'assignment-creator__button' ,
80+ 'assignment-creator__button_disabled' ,
81+ ) }
82+ type = "button"
83+ >
84+ { t ( 'assignment-creator.creating' ) }
85+ </ button > :
86+ < >
87+ < button
88+ className = { classnames (
89+ 'assignment-creator__button' ,
90+ 'assignment-creator__button_reject' ,
91+ ) }
92+ type = "button"
93+ onClick = { onCloseAssignmentCreator }
94+ >
95+ { t ( 'assignment-creator.cancel-button' ) }
96+ </ button >
97+ < button
98+ className = { classnames (
99+ 'assignment-creator__button' ,
100+ 'assignment-creator__button_confirm' ,
101+ ) }
102+ type = "button"
103+ onClick = { handleSubmit ( onDraftAssignment ) }
104+ >
105+ { t ( 'assignment-creator.draft-button' ) }
106+ </ button >
107+ < button
108+ className = { classnames (
109+ 'assignment-creator__button' ,
110+ 'assignment-creator__button_confirm' ,
111+ ) }
112+ type = "button"
113+ onClick = { handleSubmit ( onAssignAssignment ) }
114+ >
115+ { t ( 'assignment-creator.assign-button' ) }
116+ </ button >
117+ </ >
118+ }
119+ </ div >
102120 </ form >
103121 ) ;
104122}
105123
106124AssignmentCreatorForm . propTypes = {
107125 courses : ImmutablePropTypes . iterable . isRequired ,
108126 handleSubmit : PropTypes . func . isRequired ,
127+ isAssignmentExportInProgress : PropTypes . bool . isRequired ,
109128 parsedDate : PropTypes . instanceOf ( Date ) ,
110129 onAssignAssignment : PropTypes . func . isRequired ,
111130 onCloseAssignmentCreator : PropTypes . func . isRequired ,
0 commit comments