@@ -390,22 +390,32 @@ const AnnotationTag: React.FC<AnnotationTagProps> = function ({
390
390
return (
391
391
< >
392
392
< ButtonGroup size = "sm" variant = "outline" isAttached >
393
- < Tooltip label = { `${ authorText } Click to delete.` } >
393
+ < Tooltip
394
+ label = { ! isValidUsername || isReviewed ? authorText : `${ authorText } Click to delete.` }
395
+ shouldWrapChildren
396
+ mt = "3"
397
+ >
394
398
< IconButton
395
399
icon = { < FaTrash /> }
396
400
aria-label = "Delete annotation"
397
401
colorScheme = "red"
402
+ borderRadius = "var(--chakra-radii-md) 0 0 var(--chakra-radii-md)"
398
403
disabled = { ! isValidUsername || isReviewed }
399
404
onClick = { onDelete }
400
405
/>
401
406
</ Tooltip >
402
- < Tooltip label = { `${ authorText } Click to change.` } >
407
+ < Tooltip
408
+ label = { ! onEdit || ! isValidUsername || isReviewed ? authorText : `${ authorText } Click to change.` }
409
+ shouldWrapChildren
410
+ mt = "3"
411
+ >
403
412
< Button
404
413
leftIcon = { < FaWrench /> }
405
414
rightIcon = { rightIcon }
406
415
flexGrow = { 1 }
407
416
borderLeft = "none"
408
417
justifyContent = "flex-start"
418
+ borderRadius = "0 var(--chakra-radii-md) var(--chakra-radii-md) 0"
409
419
disabled = { ! onEdit || ! isValidUsername || isReviewed }
410
420
onClick = { onEdit }
411
421
>
@@ -420,7 +430,11 @@ const AnnotationTag: React.FC<AnnotationTagProps> = function ({
420
430
</ ButtonGroup >
421
431
< ButtonGroup size = "sm" variant = "outline" isAttached >
422
432
{ ( reviewResult === ReviewResult . Correct || ( isReviewed && ! reviewResult ) ) && (
423
- < Tooltip label = { `Marked as correct by ${ reviewer } . Click to undo.` } >
433
+ < Tooltip
434
+ label = { `Marked as correct by ${ reviewer } .${ ! isValidUsername ? '' : ' Click to undo.' } ` }
435
+ shouldWrapChildren
436
+ mt = "3"
437
+ >
424
438
< Button
425
439
size = "sm"
426
440
variant = "solid"
@@ -434,7 +448,11 @@ const AnnotationTag: React.FC<AnnotationTagProps> = function ({
434
448
</ Tooltip >
435
449
) }
436
450
{ reviewResult === ReviewResult . Unsure && (
437
- < Tooltip label = { `Marked as unsure by ${ reviewer } . Click to undo.` } >
451
+ < Tooltip
452
+ label = { `Marked as unsure by ${ reviewer } .${ ! isValidUsername ? '' : ' Click to undo.' } ` }
453
+ shouldWrapChildren
454
+ mt = "3"
455
+ >
438
456
< Button
439
457
size = "sm"
440
458
variant = "solid"
@@ -448,7 +466,11 @@ const AnnotationTag: React.FC<AnnotationTagProps> = function ({
448
466
</ Tooltip >
449
467
) }
450
468
{ reviewResult === ReviewResult . Wrong && (
451
- < Tooltip label = { `Marked as wrong by ${ reviewer } . Click to undo.` } >
469
+ < Tooltip
470
+ label = { `Marked as wrong by ${ reviewer } .${ ! isValidUsername ? '' : ' Click to undo.' } ` }
471
+ shouldWrapChildren
472
+ mt = "3"
473
+ >
452
474
< Button
453
475
size = "sm"
454
476
variant = "solid"
@@ -463,18 +485,50 @@ const AnnotationTag: React.FC<AnnotationTagProps> = function ({
463
485
) }
464
486
{ ! isReviewed && (
465
487
< >
466
- < Tooltip label = { `${ authorText } Click to mark as correct.` } >
467
- < Button size = "sm" variant = "outline" disabled = { ! isValidUsername } onClick = { onMarkAsCorrect } >
488
+ < Tooltip
489
+ label = { `${ authorText } ${ ! isValidUsername ? '' : ' Click to mark as correct.' } ` }
490
+ shouldWrapChildren
491
+ mt = "3"
492
+ >
493
+ < Button
494
+ size = "sm"
495
+ variant = "outline"
496
+ borderRadius = "var(--chakra-radii-md) 0 0 var(--chakra-radii-md)"
497
+ disabled = { ! isValidUsername }
498
+ onClick = { onMarkAsCorrect }
499
+ >
468
500
Mark as Correct
469
501
</ Button >
470
502
</ Tooltip >
471
- < Tooltip label = { `${ authorText } Click to mark as unsure.` } >
472
- < Button size = "sm" variant = "outline" disabled = { ! isValidUsername } onClick = { onMarkAsUnsure } >
503
+ < Tooltip
504
+ label = { `${ authorText } ${ ! isValidUsername ? '' : ' Click to mark as unsure.' } ` }
505
+ shouldWrapChildren
506
+ mt = "3"
507
+ >
508
+ < Button
509
+ size = "sm"
510
+ variant = "outline"
511
+ borderRadius = "0"
512
+ borderLeft = "none"
513
+ borderRight = "none"
514
+ disabled = { ! isValidUsername }
515
+ onClick = { onMarkAsUnsure }
516
+ >
473
517
Mark as Unsure
474
518
</ Button >
475
519
</ Tooltip >
476
- < Tooltip label = { `${ authorText } Click to mark as wrong.` } >
477
- < Button size = "sm" variant = "outline" disabled = { ! isValidUsername } onClick = { onMarkAsWrong } >
520
+ < Tooltip
521
+ label = { `${ authorText } ${ ! isValidUsername ? '' : ' Click to mark as wrong.' } ` }
522
+ shouldWrapChildren
523
+ mt = "3"
524
+ >
525
+ < Button
526
+ size = "sm"
527
+ variant = "outline"
528
+ borderRadius = "0 var(--chakra-radii-md) var(--chakra-radii-md) 0"
529
+ disabled = { ! isValidUsername }
530
+ onClick = { onMarkAsWrong }
531
+ >
478
532
Mark as Wrong
479
533
</ Button >
480
534
</ Tooltip >
0 commit comments