11import * as React from 'react' ;
22import { makeStyles } from '@material-ui/core/styles' ;
33import Box from '@material-ui/core/Box' ;
4+ import Grid from '@material-ui/core/Grid' ;
45import Typography from '@material-ui/core/Typography' ;
56import IconButton from '@material-ui/core/IconButton' ;
67import TreeItem from '@material-ui/lab/TreeItem' ;
78import Visibility from '@material-ui/icons/Visibility' ;
89import ColorLens from '@material-ui/icons/ColorLens' ;
910import { ChromePicker } from 'react-color' ;
10- import { bgInputs } from '../../theme' ;
11+ import { experimentLabelColor } from '../../theme' ;
1112
1213const useStyles = makeStyles ( ( theme ) => ( {
1314 networkItem : {
@@ -18,7 +19,7 @@ const useStyles = makeStyles((theme) => ({
1819 '& .MuiIconButton-root' : {
1920 padding : 0 ,
2021 marginLeft : '0.5rem' ,
21- color : bgInputs ,
22+ color : experimentLabelColor ,
2223 '&:hover' : {
2324 color : 'white' ,
2425 } ,
@@ -39,7 +40,6 @@ const ControlPanelTreeItem = (props) => {
3940
4041 const handleColorSelection = ( color ) => {
4142 setColor ( color . hex ) ;
42- console . log ( 'color changed' , color . hex ) ;
4343 } ;
4444
4545 const {
@@ -56,37 +56,40 @@ const ControlPanelTreeItem = (props) => {
5656 < TreeItem
5757 nodeId = { nodeId }
5858 label = { (
59- < Box
59+ < Grid
60+ container
6061 className = { classes . networkItem }
6162 onMouseEnter = { ( ) => setIsHoveredOver ( true ) }
6263 onMouseLeave = { ( ) => setIsHoveredOver ( false ) }
6364 display = "flex"
6465 flexDirection = "row"
6566 justifyContent = "space-between"
6667 >
67- < Typography onClick = { ( event ) => onNodeSelect ( event , nodeId ) } > { label } </ Typography >
68- < Typography > { type } </ Typography >
69- {
70- isHoveredOver
68+ < Grid item xs = { 4 } > < Typography onClick = { ( event ) => onNodeSelect ( event , nodeId ) } > { label } </ Typography > </ Grid >
69+ < Grid item xs = { 4 } justifyContent = "center" > < Typography > { type } </ Typography > </ Grid >
70+ < Grid item xs = { 4 } justifyContent = "flex-end" className = { classes . controls } >
71+ { isHoveredOver
7172 ? (
72- < Box className = { classes . controls } >
73+ < >
74+
7375 < IconButton onClick = { ( event ) => onVisibilityClick ( event , nodeId ) } > < Visibility /> </ IconButton >
7476 < IconButton onClick = { ( ) => setShowColorPicker ( ! showColorPicker ) } > < ColorLens /> </ IconButton >
7577 {
76- showColorPicker
77- ? (
78- < ChromePicker
79- className = { classes . colorPicker }
80- color = { color }
81- onChangeComplete = { handleColorSelection }
82- />
83- ) : null
78+ showColorPicker
79+ ? (
80+ < ChromePicker
81+ className = { classes . colorPicker }
82+ color = { color }
83+ onChangeComplete = { handleColorSelection }
84+ />
85+ ) : null
8486 }
85- </ Box >
87+
88+ </ >
8689 )
87- : null
88- }
89- </ Box >
90+ : null }
91+ </ Grid >
92+ </ Grid >
9093 ) }
9194 >
9295 { children }
0 commit comments