Skip to content

Commit

Permalink
#148 changed background color of "A" button in molecule view so it is…
Browse files Browse the repository at this point in the history
… darker if it has some other options active
  • Loading branch information
matej-vavrek authored and tibor-postek-m2ms committed Mar 9, 2020
1 parent 786bf50 commit cd6614e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 13 additions & 3 deletions js/components/preview/molecule/moleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const useStyles = makeStyles(theme => ({
backgroundColor: theme.palette.primary.main,
color: theme.palette.primary.contrastText
},
contColButtonHalfSelected: {
backgroundColor: theme.palette.primary.semidark
},
detailsCol: {
border: 'solid 1px',
borderColor: theme.palette.background.divider,
Expand Down Expand Up @@ -141,6 +144,7 @@ const MoleculeView = memo(({ imageHeight, imageWidth, data }) => {
const isVectorOn = (currentID && vectorOnList.includes(currentID)) || false;

const hasAllValuesOn = isLigandOn && isComplexOn && isVectorOn;
const hasSomeValuesOn = !hasAllValuesOn && (isLigandOn || isComplexOn || isVectorOn);

const disableUserInteraction = useDisableUserInteraction();

Expand Down Expand Up @@ -339,9 +343,15 @@ const MoleculeView = memo(({ imageHeight, imageWidth, data }) => {
<Grid item>
<Button
variant="outlined"
className={classNames(classes.contColButton, {
[classes.contColButtonSelected]: hasAllValuesOn
})}
className={classNames(
classes.contColButton,
{
[classes.contColButtonSelected]: hasAllValuesOn
},
{
[classes.contColButtonHalfSelected]: hasSomeValuesOn
}
)}
onClick={() => {
selectedAll.current = !selectedAll.current;

Expand Down
3 changes: 2 additions & 1 deletion js/theme/palette.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default {
contrastText: white,
dark: colors.indigo[900],
main: colors.indigo[500],
light: colors.indigo[100]
light: colors.indigo[100],
semidark: colors.indigo[300]
},
secondary: {
contrastText: white,
Expand Down

0 comments on commit cd6614e

Please sign in to comment.