Commit 180aaae8 authored by Imran Salam's avatar Imran Salam
Browse files

hide browser tabs when track panel is closed

parent b8c3e745
Pipeline #14997 failed with stage
in 3 minutes and 26 seconds
......@@ -46,6 +46,10 @@
text-transform: lowercase;
}
&.browserInfoExpanded {
width: calc(100vw - 36px);
}
&.browserInfoGreyed {
.value,
.nonLabelValue {
......
......@@ -20,7 +20,8 @@ import {
getDrawerOpened,
getSelectedBrowserTab,
getObjectInfo,
getTrackPanelModalOpened
getTrackPanelModalOpened,
getTrackPanelOpened
} from '../browserSelectors';
import { RootState } from 'src/store';
......@@ -40,6 +41,7 @@ type StateProps = {
objectInfo: any;
selectedBrowserTab: TrackType;
trackPanelModalOpened: boolean;
trackPanelOpened: boolean;
};
type DispatchProps = {
......@@ -86,6 +88,10 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = (
const getBrowserInfoClasses = () => {
let classNames = styles.browserInfo;
if (props.trackPanelOpened === false) {
classNames += ` ${styles.browserInfoExpanded}`;
}
if (props.drawerOpened === true) {
classNames += ` ${styles.browserInfoGreyed}`;
}
......@@ -166,14 +172,16 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = (
)}
</dl>
</div>
<BrowserTabs
drawerOpened={props.drawerOpened}
genomeSelectorActive={props.genomeSelectorActive}
selectBrowserTab={props.selectBrowserTab}
selectedBrowserTab={props.selectedBrowserTab}
toggleDrawer={props.toggleDrawer}
trackPanelModalOpened={props.trackPanelModalOpened}
/>
{props.trackPanelOpened ? (
<BrowserTabs
drawerOpened={props.drawerOpened}
genomeSelectorActive={props.genomeSelectorActive}
selectBrowserTab={props.selectBrowserTab}
selectedBrowserTab={props.selectedBrowserTab}
toggleDrawer={props.toggleDrawer}
trackPanelModalOpened={props.trackPanelModalOpened}
/>
) : null}
</div>
);
};
......@@ -187,7 +195,8 @@ const mapStateToProps = (state: RootState): StateProps => ({
genomeSelectorActive: getGenomeSelectorActive(state),
objectInfo: getObjectInfo(state),
selectedBrowserTab: getSelectedBrowserTab(state),
trackPanelModalOpened: getTrackPanelModalOpened(state)
trackPanelModalOpened: getTrackPanelModalOpened(state),
trackPanelOpened: getTrackPanelOpened(state)
});
const mapDispatchToProps: DispatchProps = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment