File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
src/packages/frontend/course Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -308,13 +308,16 @@ export const AssignmentsPanel: React.FC<Props> = React.memo((props: Props) => {
308
308
} ) ;
309
309
310
310
// used for adding assignments outside of the above component.
311
- export function AddAssignments ( { name, actions } ) {
311
+ export function AddAssignments ( { name, actions, close } ) {
312
312
const assignments = useRedux ( name , "assignments" ) ;
313
313
return (
314
314
< AddItems
315
315
itemName = "assignment"
316
316
items = { assignments }
317
- addItems = { actions . assignments . addAssignment }
317
+ addItems = { ( paths ) => {
318
+ actions . assignments . addAssignment ( paths ) ;
319
+ close ?.( ) ;
320
+ } }
318
321
selectorStyle = { {
319
322
position : null ,
320
323
width : "100%" ,
Original file line number Diff line number Diff line change @@ -239,13 +239,16 @@ export function HandoutsPanelHeader(props: { n: number }) {
239
239
}
240
240
241
241
// used for adding assignments outside of the above component.
242
- export function AddHandouts ( { name, actions } ) {
242
+ export function AddHandouts ( { name, actions, close } ) {
243
243
const handouts = useRedux ( name , "handouts" ) ;
244
244
return (
245
245
< AddItems
246
246
itemName = "handout"
247
247
items = { handouts }
248
- addItems = { actions . assignments . addHandout }
248
+ addItems = { ( paths ) => {
249
+ actions . handouts . addHandout ( paths ) ;
250
+ close ?.( ) ;
251
+ } }
249
252
selectorStyle = { {
250
253
position : null ,
251
254
width : "100%" ,
You can’t perform that action at this time.
0 commit comments