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 committed Mar 5, 2020
1 parent 9701180 commit ec174ba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fragalysis-frontend",
"version": "0.2.1",
"version": "0.2.2",
"description": "Frontend for fragalysis",
"main": "webpack.config.js",
"scripts": {
Expand Down

0 comments on commit ec174ba

Please sign in to comment.