Skip to content
Snippets Groups Projects
Commit 41f9bf10 authored by Jessie Keck's avatar Jessie Keck
Browse files

Add an action state on the Info icon when the Info panel is open.

parent bfe4d4d4
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ class WindowSideBar extends Component {
}}
>
<List>
<WindowSideBarButtons windowId={windowId} />
<WindowSideBarButtons windowId={windowId} sideBarPanel={sideBarPanel} />
</List>
</Drawer>
<Drawer
......
......@@ -7,6 +7,16 @@ import InfoIcon from '@material-ui/icons/Info';
*
*/
class WindowSideBarButtons extends Component {
/**
* sideBarPanelCurrentlySelected - return if the given sideBarPanel is currently selected
* @return Boolean
*/
sideBarPanelCurrentlySelected(panelType) {
const { sideBarPanel } = this.props;
return sideBarPanel === panelType;
}
/**
* render
*
......@@ -21,7 +31,9 @@ class WindowSideBarButtons extends Component {
color="inherit"
onClick={() => (toggleWindowSideBarPanel('info'))}
>
<InfoIcon />
<InfoIcon
color={this.sideBarPanelCurrentlySelected('info') ? 'action' : 'inherit'}
/>
</IconButton>
</>
);
......@@ -30,10 +42,12 @@ class WindowSideBarButtons extends Component {
WindowSideBarButtons.propTypes = {
toggleWindowSideBarPanel: PropTypes.func,
sideBarPanel: PropTypes.string,
};
WindowSideBarButtons.defaultProps = {
toggleWindowSideBarPanel: () => {},
sideBarPanel: 'closed',
};
export default WindowSideBarButtons;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment