@@ -11,13 +11,7 @@ import {
11
11
CSS ,
12
12
} from "@cocalc/frontend/app-framework" ;
13
13
import { capitalize , trunc_middle } from "@cocalc/util/misc" ;
14
- import { Alert , Card , Col , Row } from "antd" ;
15
- import {
16
- Button ,
17
- ButtonGroup ,
18
- FormControl ,
19
- FormGroup ,
20
- } from "../../antd-bootstrap" ;
14
+ import { Alert , Button , Input , Card , Col , Row , Space } from "antd" ;
21
15
import { Icon , MarkdownInput , Tip } from "../../components" ;
22
16
import { UserMap } from "../../todo-types" ;
23
17
import { CourseActions } from "../actions" ;
@@ -251,26 +245,23 @@ export const Handout: React.FC<HandoutProps> = React.memo(
251
245
< div style = { { marginTop : "15px" } } >
252
246
Type in "OVERWRITE" if you are certain to replace the handout files of
253
247
all students.
254
- < FormGroup >
255
- < FormControl
256
- autoFocus
257
- type = "text"
258
- onChange = { ( e ) =>
259
- set_copy_handout_confirm_overwrite_text ( ( e . target as any ) . value )
260
- }
261
- style = { { marginTop : "1ex" } }
262
- />
263
- </ FormGroup >
264
- < ButtonGroup style = { { textAlign : "center" , marginTop : "15px" } } >
248
+ < Input
249
+ autoFocus
250
+ onChange = { ( e ) =>
251
+ set_copy_handout_confirm_overwrite_text ( e . target . value )
252
+ }
253
+ style = { { marginTop : "1ex" } }
254
+ />
255
+ < Space style = { { textAlign : "center" , marginTop : "15px" } } >
256
+ { render_copy_cancel ( ) }
265
257
< Button
266
258
disabled = { copy_handout_confirm_overwrite_text !== "OVERWRITE" }
267
- bsStyle = " danger"
259
+ danger
268
260
onClick = { do_it }
269
261
>
270
262
< Icon name = "exclamation-triangle" /> Confirm replacing files
271
263
</ Button >
272
- { render_copy_cancel ( ) }
273
- </ ButtonGroup >
264
+ </ Space >
274
265
</ div >
275
266
) ;
276
267
}
@@ -307,16 +298,16 @@ export const Handout: React.FC<HandoutProps> = React.memo(
307
298
{ step_direction ( step ) } the { n } student{ n > 1 ? "s" : "" }
308
299
{ step_ready ( step ) } ?
309
300
</ div >
310
- < ButtonGroup >
301
+ < Space >
302
+ { render_copy_cancel ( ) }
311
303
< Button
312
304
key = "yes"
313
- bsStyle = "primary"
305
+ type = "primary"
314
306
onClick = { ( ) => copy_handout ( step , false ) }
315
307
>
316
308
Yes
317
309
</ Button >
318
- { render_copy_cancel ( ) }
319
- </ ButtonGroup >
310
+ </ Space >
320
311
</ div >
321
312
}
322
313
/>
@@ -340,23 +331,19 @@ export const Handout: React.FC<HandoutProps> = React.memo(
340
331
< div style = { { marginBottom : "15px" } } >
341
332
{ copy_confirm_all_caution ( step ) }
342
333
</ div >
343
- < ButtonGroup >
344
- < Button
345
- key = "all"
346
- bsStyle = "warning"
347
- onClick = { ( ) => copy_handout ( step , false ) }
348
- >
334
+ < Space >
335
+ { render_copy_cancel ( ) }
336
+ < Button key = "all" onClick = { ( ) => copy_handout ( step , false ) } >
349
337
Yes, do it
350
338
</ Button >
351
339
< Button
352
340
key = "all-overwrite"
353
- bsStyle = " danger"
341
+ danger
354
342
onClick = { ( ) => set_copy_handout_confirm_overwrite ( true ) }
355
343
>
356
344
Replace student files!
357
345
</ Button >
358
- { render_copy_cancel ( ) }
359
- </ ButtonGroup >
346
+ </ Space >
360
347
{ render_copy_handout_confirm_overwrite ( step ) }
361
348
</ div >
362
349
) ;
@@ -377,10 +364,11 @@ export const Handout: React.FC<HandoutProps> = React.memo(
377
364
{ step_direction ( step ) }
378
365
...
379
366
</ div >
380
- < ButtonGroup >
367
+ < Space >
368
+ { render_copy_cancel ( ) }
381
369
< Button
382
370
key = "all"
383
- bsStyle = " danger"
371
+ danger
384
372
onClick = { ( ) => {
385
373
set_copy_confirm_all_handout ( true ) ;
386
374
set_copy_confirm ( true ) ;
@@ -394,15 +382,14 @@ export const Handout: React.FC<HandoutProps> = React.memo(
394
382
{ n ? (
395
383
< Button
396
384
key = "new"
397
- bsStyle = "primary"
385
+ type = "primary"
398
386
onClick = { ( ) => copy_handout ( step , true ) }
399
387
>
400
388
The { n } student{ n > 1 ? "s" : "" } not already{ " " }
401
389
{ past_tense ( step_verb ( step ) ) } { step_direction ( step ) }
402
390
</ Button >
403
391
) : undefined }
404
- { render_copy_cancel ( ) }
405
- </ ButtonGroup >
392
+ </ Space >
406
393
{ copy_confirm_all_handout
407
394
? render_copy_confirm_overwrite_all ( step )
408
395
: undefined }
@@ -413,22 +400,11 @@ export const Handout: React.FC<HandoutProps> = React.memo(
413
400
}
414
401
415
402
function render_handout_button ( status ) : Rendered {
416
- let bsStyle ;
417
403
const handout_count = status . handout ;
418
- const { not_handout } = status ;
419
- if ( handout_count === 0 ) {
420
- bsStyle = "primary" ;
421
- } else {
422
- if ( not_handout === 0 ) {
423
- bsStyle = "success" ;
424
- } else {
425
- bsStyle = "warning" ;
426
- }
427
- }
428
404
return (
429
405
< Button
430
406
key = "handout"
431
- bsStyle = { bsStyle }
407
+ type = { handout_count === 0 ? "primary" : undefined }
432
408
onClick = { ( ) => {
433
409
set_copy_confirm_handout ( true ) ;
434
410
set_copy_confirm ( true ) ;
@@ -469,14 +445,14 @@ export const Handout: React.FC<HandoutProps> = React.memo(
469
445
< div >
470
446
Are you sure you want to delete this handout?
471
447
< br /> < br />
472
- < ButtonGroup >
473
- < Button key = "yes" onClick = { delete_handout } bsStyle = "danger" >
474
- < Icon name = "trash" /> Delete
475
- </ Button >
448
+ < Space >
476
449
< Button key = "no" onClick = { ( ) => set_confirm_delete ( false ) } >
477
450
Cancel
478
451
</ Button >
479
- </ ButtonGroup >
452
+ < Button key = "yes" onClick = { delete_handout } danger >
453
+ < Icon name = "trash" /> Delete
454
+ </ Button >
455
+ </ Space >
480
456
</ div >
481
457
}
482
458
/>
@@ -590,13 +566,15 @@ export const Handout: React.FC<HandoutProps> = React.memo(
590
566
}
591
567
return (
592
568
< Row key = "summary" style = { { backgroundColor : backgroundColor } } >
593
- < Col md = { 4 } style = { { paddingRight : "0px" } } >
569
+ < Col md = { 8 } style = { { paddingRight : "0px" } } >
594
570
{ render_handout_name ( ) }
595
571
</ Col >
596
- < Col md = { 12 } >
572
+ < Col md = { 8 } >
597
573
< Row style = { { marginLeft : "8px" } } >
598
574
{ render_handout_button ( status ) }
599
- < span style = { { color : "#666" , marginLeft : "5px" } } >
575
+ < span
576
+ style = { { color : "#666" , marginLeft : "5px" , marginTop : "10px" } }
577
+ >
600
578
({ status . handout } /{ status . handout + status . not_handout } { " " }
601
579
transferred)
602
580
</ span >
0 commit comments