@@ -469,66 +469,43 @@ const MoleculeView = memo(
469
469
return cssClass ;
470
470
} ;
471
471
472
- const handleClickOnDownArrow = ( ) => {
473
- if ( nextItemData ) {
472
+ const moveSelectedMolSettings = newItemDataset => {
473
+ if ( newItemDataset ) {
474
474
if ( isLigandOn ) {
475
- dispatch ( addLigand ( stage , nextItemData , colourToggle ) ) ;
475
+ dispatch ( addLigand ( stage , newItemDataset , colourToggle ) ) ;
476
476
removeSelectedLigand ( ) ;
477
477
}
478
478
if ( isProteinOn ) {
479
- dispatch ( addHitProtein ( stage , nextItemData , colourToggle ) ) ;
479
+ dispatch ( addHitProtein ( stage , newItemDataset , colourToggle ) ) ;
480
480
removeSelectedProtein ( ) ;
481
481
}
482
482
if ( isComplexOn ) {
483
- dispatch ( addComplex ( stage , nextItemData , colourToggle ) ) ;
483
+ dispatch ( addComplex ( stage , newItemDataset , colourToggle ) ) ;
484
484
removeSelectedComplex ( ) ;
485
485
}
486
486
if ( isSurfaceOn ) {
487
- dispatch ( addSurface ( stage , nextItemData , colourToggle ) ) ;
487
+ dispatch ( addSurface ( stage , newItemDataset , colourToggle ) ) ;
488
488
removeSelectedSurface ( ) ;
489
489
}
490
490
if ( isDensityOn ) {
491
- dispatch ( addDensity ( stage , nextItemData , colourToggle ) ) ;
491
+ dispatch ( addDensity ( stage , newItemDataset , colourToggle ) ) ;
492
492
removeSelectedDensity ( ) ;
493
493
}
494
494
if ( isVectorOn ) {
495
- dispatch ( addVector ( stage , nextItemData ) ) . catch ( error => {
495
+ dispatch ( addVector ( stage , newItemDataset ) ) . catch ( error => {
496
496
throw new Error ( error ) ;
497
497
} ) ;
498
498
removeSelectedVector ( ) ;
499
499
}
500
500
}
501
501
} ;
502
502
503
+ const handleClickOnDownArrow = ( ) => {
504
+ moveSelectedMolSettings ( nextItemData ) ;
505
+ } ;
506
+
503
507
const handleClickOnUpArrow = ( ) => {
504
- if ( previousItemData ) {
505
- if ( isLigandOn ) {
506
- dispatch ( addLigand ( stage , previousItemData , colourToggle ) ) ;
507
- removeSelectedLigand ( ) ;
508
- }
509
- if ( isProteinOn ) {
510
- dispatch ( addHitProtein ( stage , previousItemData , colourToggle ) ) ;
511
- removeSelectedProtein ( ) ;
512
- }
513
- if ( isComplexOn ) {
514
- dispatch ( addComplex ( stage , previousItemData , colourToggle ) ) ;
515
- removeSelectedComplex ( ) ;
516
- }
517
- if ( isSurfaceOn ) {
518
- dispatch ( addSurface ( stage , previousItemData , colourToggle ) ) ;
519
- removeSelectedSurface ( ) ;
520
- }
521
- if ( isDensityOn ) {
522
- dispatch ( addDensity ( stage , previousItemData , colourToggle ) ) ;
523
- removeSelectedDensity ( ) ;
524
- }
525
- if ( isVectorOn ) {
526
- dispatch ( addVector ( stage , previousItemData ) ) . catch ( error => {
527
- throw new Error ( error ) ;
528
- } ) ;
529
- removeSelectedVector ( ) ;
530
- }
531
- }
508
+ moveSelectedMolSettings ( previousItemData ) ;
532
509
} ;
533
510
534
511
let moleculeTitle = data ?. protein_code . replace ( `${ target_on_name } -` , '' ) ;
@@ -721,16 +698,14 @@ const MoleculeView = memo(
721
698
< Grid item >
722
699
< Grid container direction = "column" justify = "space-between" className = { classes . arrows } >
723
700
< Grid item >
724
- < Tooltip title = "secondary" >
725
- < IconButton
726
- color = "primary"
727
- size = "small"
728
- disabled = { disableUserInteraction || ! previousItemData }
729
- onClick = { handleClickOnUpArrow }
730
- >
731
- < ArrowUpward className = { classes . arrow } />
732
- </ IconButton >
733
- </ Tooltip >
701
+ < IconButton
702
+ color = "primary"
703
+ size = "small"
704
+ disabled = { disableUserInteraction || ! previousItemData }
705
+ onClick = { handleClickOnUpArrow }
706
+ >
707
+ < ArrowUpward className = { classes . arrow } />
708
+ </ IconButton >
734
709
</ Grid >
735
710
< Grid item >
736
711
< IconButton
0 commit comments