Commit 4b8ec1b5 authored by Imran Salam's avatar Imran Salam
Browse files

make selectors return the genome specific values for drawer and some browser...

make selectors return the genome specific values for drawer and some browser specific state properties
parent 10111976
...@@ -35,7 +35,7 @@ import { ...@@ -35,7 +35,7 @@ import {
import { getLaunchbarExpanded } from 'src/header/headerSelectors'; import { getLaunchbarExpanded } from 'src/header/headerSelectors';
import { getTrackPanelOpened } from './track-panel/trackPanelSelectors'; import { getTrackPanelOpened } from './track-panel/trackPanelSelectors';
import { getChrLocationFromStr, getChrLocationStr } from './browserHelper'; import { getChrLocationFromStr, getChrLocationStr } from './browserHelper';
import { getDrawerOpened } from './drawer/drawerSelectors'; import { getIsDrawerOpened } from './drawer/drawerSelectors';
import { getEnabledCommittedSpecies } from 'src/content/app/species-selector/state/speciesSelectorSelectors'; import { getEnabledCommittedSpecies } from 'src/content/app/species-selector/state/speciesSelectorSelectors';
import { CommittedItem } from 'src/content/app/species-selector/types/species-search'; import { CommittedItem } from 'src/content/app/species-selector/types/species-search';
import { getExampleEnsObjects } from 'src/ens-object/ensObjectSelectors'; import { getExampleEnsObjects } from 'src/ens-object/ensObjectSelectors';
...@@ -55,7 +55,7 @@ import styles from './Browser.scss'; ...@@ -55,7 +55,7 @@ import styles from './Browser.scss';
import 'static/browser/browser.js'; import 'static/browser/browser.js';
type StateProps = { type StateProps = {
activeGenomeId: string; activeGenomeId: string | null;
activeEnsObjectId: string | null; activeEnsObjectId: string | null;
allActiveEnsObjectIds: { [genomeId: string]: string }; allActiveEnsObjectIds: { [genomeId: string]: string };
browserActivated: boolean; browserActivated: boolean;
...@@ -63,7 +63,7 @@ type StateProps = { ...@@ -63,7 +63,7 @@ type StateProps = {
browserQueryParams: { [key: string]: string }; browserQueryParams: { [key: string]: string };
chrLocation: ChrLocation | null; chrLocation: ChrLocation | null;
allChrLocations: { [genomeId: string]: ChrLocation }; allChrLocations: { [genomeId: string]: ChrLocation };
drawerOpened: { [genomeId: string]: boolean }; isDrawerOpened: boolean;
genomeSelectorActive: boolean; genomeSelectorActive: boolean;
trackPanelOpened: boolean; trackPanelOpened: boolean;
launchbarExpanded: boolean; launchbarExpanded: boolean;
...@@ -79,7 +79,7 @@ type DispatchProps = { ...@@ -79,7 +79,7 @@ type DispatchProps = {
) => void; ) => void;
fetchGenomeData: (genomeId: string) => void; fetchGenomeData: (genomeId: string) => void;
replace: Replace; replace: Replace;
toggleDrawer: (drawerOpened: boolean) => void; toggleDrawer: (isDrawerOpened: boolean) => void;
setDataFromUrlAndSave: (payload: ParsedUrlPayload) => void; setDataFromUrlAndSave: (payload: ParsedUrlPayload) => void;
}; };
...@@ -102,7 +102,8 @@ export const Browser: FunctionComponent<BrowserProps> = ( ...@@ -102,7 +102,8 @@ export const Browser: FunctionComponent<BrowserProps> = (
TrackStates TrackStates
>({}); >({});
const lastGenomeIdRef = useRef(props.activeGenomeId); const lastGenomeIdRef = useRef(props.activeGenomeId);
const drawerOpenedForGenome = props.drawerOpened[props.activeGenomeId];
const { isDrawerOpened } = props;
const setDataFromUrl = () => { const setDataFromUrl = () => {
const { genomeId = null } = props.match.params; const { genomeId = null } = props.match.params;
...@@ -254,7 +255,7 @@ export const Browser: FunctionComponent<BrowserProps> = ( ...@@ -254,7 +255,7 @@ export const Browser: FunctionComponent<BrowserProps> = (
}, [props.chrLocation]); }, [props.chrLocation]);
const closeTrack = () => { const closeTrack = () => {
if (drawerOpenedForGenome === false) { if (isDrawerOpened) {
return; return;
} }
...@@ -268,7 +269,7 @@ export const Browser: FunctionComponent<BrowserProps> = ( ...@@ -268,7 +269,7 @@ export const Browser: FunctionComponent<BrowserProps> = (
})); }));
const getBrowserWidth = (): string => { const getBrowserWidth = (): string => {
if (drawerOpenedForGenome === true) { if (isDrawerOpened) {
return 'calc(41px + 0vw)'; return 'calc(41px + 0vw)';
} }
return props.trackPanelOpened return props.trackPanelOpened
...@@ -280,7 +281,7 @@ export const Browser: FunctionComponent<BrowserProps> = ( ...@@ -280,7 +281,7 @@ export const Browser: FunctionComponent<BrowserProps> = (
setTrackAnimation({ setTrackAnimation({
width: getBrowserWidth() width: getBrowserWidth()
}); });
}, [drawerOpenedForGenome, props.trackPanelOpened]); }, [isDrawerOpened, props.trackPanelOpened]);
const getHeightClass = (launchbarExpanded: boolean): string => { const getHeightClass = (launchbarExpanded: boolean): string => {
return launchbarExpanded ? styles.shorter : styles.taller; return launchbarExpanded ? styles.shorter : styles.taller;
...@@ -314,7 +315,7 @@ export const Browser: FunctionComponent<BrowserProps> = ( ...@@ -314,7 +315,7 @@ export const Browser: FunctionComponent<BrowserProps> = (
<animated.div style={trackAnimation}> <animated.div style={trackAnimation}>
<div className={styles.browserImageWrapper} onClick={closeTrack}> <div className={styles.browserImageWrapper} onClick={closeTrack}>
{props.browserNavOpened && {props.browserNavOpened &&
!drawerOpenedForGenome && !isDrawerOpened &&
browserRef.current ? ( browserRef.current ? (
<BrowserNavBar browserElement={browserRef.current} /> <BrowserNavBar browserElement={browserRef.current} />
) : null} ) : null}
...@@ -369,7 +370,7 @@ const mapStateToProps = (state: RootState): StateProps => ({ ...@@ -369,7 +370,7 @@ const mapStateToProps = (state: RootState): StateProps => ({
browserQueryParams: getBrowserQueryParams(state), browserQueryParams: getBrowserQueryParams(state),
chrLocation: getChrLocation(state), chrLocation: getChrLocation(state),
allChrLocations: getAllChrLocations(state), allChrLocations: getAllChrLocations(state),
drawerOpened: getDrawerOpened(state), isDrawerOpened: getIsDrawerOpened(state),
genomeSelectorActive: getGenomeSelectorActive(state), genomeSelectorActive: getGenomeSelectorActive(state),
trackPanelOpened: getTrackPanelOpened(state), trackPanelOpened: getTrackPanelOpened(state),
launchbarExpanded: getLaunchbarExpanded(state), launchbarExpanded: getLaunchbarExpanded(state),
......
...@@ -16,7 +16,7 @@ import { ...@@ -16,7 +16,7 @@ import {
getBrowserActiveGenomeId, getBrowserActiveGenomeId,
getBrowserActiveEnsObject getBrowserActiveEnsObject
} from '../browserSelectors'; } from '../browserSelectors';
import { getDrawerOpened } from '../drawer/drawerSelectors'; import { getIsDrawerOpened } from '../drawer/drawerSelectors';
import { import {
getSelectedBrowserTab, getSelectedBrowserTab,
getTrackPanelModalOpened, getTrackPanelModalOpened,
...@@ -34,15 +34,15 @@ import BrowserTabs from '../browser-tabs/BrowserTabs'; ...@@ -34,15 +34,15 @@ import BrowserTabs from '../browser-tabs/BrowserTabs';
import styles from './BrowserBar.scss'; import styles from './BrowserBar.scss';
type StateProps = { type StateProps = {
activeGenomeId: string; activeGenomeId: string | null;
browserActivated: boolean; browserActivated: boolean;
browserNavOpened: boolean; browserNavOpened: boolean;
chrLocation: ChrLocation | null; chrLocation: ChrLocation | null;
defaultChrLocation: ChrLocation | null; defaultChrLocation: ChrLocation | null;
drawerOpened: { [genomeId: string]: boolean }; isDrawerOpened: boolean;
genomeSelectorActive: boolean; genomeSelectorActive: boolean;
ensObject: EnsObject | null; ensObject: EnsObject | null;
selectedBrowserTab: { [genomeId: string]: TrackType }; selectedBrowserTab: TrackType;
trackPanelModalOpened: boolean; trackPanelModalOpened: boolean;
trackPanelOpened: boolean; trackPanelOpened: boolean;
}; };
...@@ -50,7 +50,7 @@ type StateProps = { ...@@ -50,7 +50,7 @@ type StateProps = {
type DispatchProps = { type DispatchProps = {
selectBrowserTabAndSave: (selectedBrowserTab: TrackType) => void; selectBrowserTabAndSave: (selectedBrowserTab: TrackType) => void;
toggleBrowserNav: () => void; toggleBrowserNav: () => void;
toggleDrawer: (drawerOpened: boolean) => void; toggleDrawer: (isDrawerOpened: boolean) => void;
toggleGenomeSelector: (genomeSelectorActive: boolean) => void; toggleGenomeSelector: (genomeSelectorActive: boolean) => void;
}; };
...@@ -73,7 +73,7 @@ type BrowserNavigatorButtonProps = { ...@@ -73,7 +73,7 @@ type BrowserNavigatorButtonProps = {
export const BrowserBar: FunctionComponent<BrowserBarProps> = ( export const BrowserBar: FunctionComponent<BrowserBarProps> = (
props: BrowserBarProps props: BrowserBarProps
) => { ) => {
const drawerOpenedForGenome = props.drawerOpened[props.activeGenomeId]; const { isDrawerOpened } = props;
const shouldShowBrowserInfo = () => { const shouldShowBrowserInfo = () => {
const { defaultChrLocation } = props; const { defaultChrLocation } = props;
...@@ -99,7 +99,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = ( ...@@ -99,7 +99,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = (
}, [props.defaultChrLocation, props.genomeSelectorActive]); }, [props.defaultChrLocation, props.genomeSelectorActive]);
const getBrowserNavIcon = () => { const getBrowserNavIcon = () => {
if (drawerOpenedForGenome === true) { if (isDrawerOpened) {
return navigator.icon.grey as string; return navigator.icon.grey as string;
} else if (props.browserNavOpened) { } else if (props.browserNavOpened) {
return navigator.icon.selected as string; return navigator.icon.selected as string;
...@@ -109,7 +109,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = ( ...@@ -109,7 +109,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = (
}; };
const toggleNavigator = () => { const toggleNavigator = () => {
if (drawerOpenedForGenome === true) { if (isDrawerOpened) {
return; return;
} }
...@@ -118,7 +118,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = ( ...@@ -118,7 +118,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = (
const className = classNames(styles.browserInfo, { const className = classNames(styles.browserInfo, {
[styles.browserInfoExpanded]: !props.trackPanelOpened, [styles.browserInfoExpanded]: !props.trackPanelOpened,
[styles.browserInfoGreyed]: drawerOpenedForGenome [styles.browserInfoGreyed]: isDrawerOpened
}); });
if (!(props.chrLocation && props.ensObject)) { if (!(props.chrLocation && props.ensObject)) {
...@@ -134,7 +134,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = ( ...@@ -134,7 +134,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = (
dispatchBrowserLocation={props.dispatchBrowserLocation} dispatchBrowserLocation={props.dispatchBrowserLocation}
chrLocation={props.chrLocation} chrLocation={props.chrLocation}
defaultChrLocation={props.defaultChrLocation} defaultChrLocation={props.defaultChrLocation}
drawerOpened={props.drawerOpened} isDrawerOpened={isDrawerOpened}
/> />
{showBrowserInfo && <BrowserInfo ensObject={props.ensObject} />} {showBrowserInfo && <BrowserInfo ensObject={props.ensObject} />}
</dl> </dl>
...@@ -144,7 +144,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = ( ...@@ -144,7 +144,7 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = (
browserActivated={props.browserActivated} browserActivated={props.browserActivated}
dispatchBrowserLocation={props.dispatchBrowserLocation} dispatchBrowserLocation={props.dispatchBrowserLocation}
chrLocation={props.chrLocation} chrLocation={props.chrLocation}
drawerOpened={props.drawerOpened} isDrawerOpened={isDrawerOpened}
genomeSelectorActive={props.genomeSelectorActive} genomeSelectorActive={props.genomeSelectorActive}
toggleGenomeSelector={props.toggleGenomeSelector} toggleGenomeSelector={props.toggleGenomeSelector}
/> />
...@@ -159,9 +159,8 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = ( ...@@ -159,9 +159,8 @@ export const BrowserBar: FunctionComponent<BrowserBarProps> = (
</div> </div>
{props.trackPanelOpened && props.activeGenomeId && ( {props.trackPanelOpened && props.activeGenomeId && (
<BrowserTabs <BrowserTabs
activeGenomeId={props.activeGenomeId}
ensObject={props.ensObject} ensObject={props.ensObject}
drawerOpened={props.drawerOpened} isDrawerOpened={props.isDrawerOpened}
genomeSelectorActive={props.genomeSelectorActive} genomeSelectorActive={props.genomeSelectorActive}
selectBrowserTabAndSave={props.selectBrowserTabAndSave} selectBrowserTabAndSave={props.selectBrowserTabAndSave}
selectedBrowserTab={props.selectedBrowserTab} selectedBrowserTab={props.selectedBrowserTab}
...@@ -228,7 +227,7 @@ const mapStateToProps = (state: RootState): StateProps => ({ ...@@ -228,7 +227,7 @@ const mapStateToProps = (state: RootState): StateProps => ({
browserNavOpened: getBrowserNavOpened(state), browserNavOpened: getBrowserNavOpened(state),
chrLocation: getChrLocation(state), chrLocation: getChrLocation(state),
defaultChrLocation: getDefaultChrLocation(state), defaultChrLocation: getDefaultChrLocation(state),
drawerOpened: getDrawerOpened(state), isDrawerOpened: getIsDrawerOpened(state),
ensObject: getBrowserActiveEnsObject(state), ensObject: getBrowserActiveEnsObject(state),
genomeSelectorActive: getGenomeSelectorActive(state), genomeSelectorActive: getGenomeSelectorActive(state),
selectedBrowserTab: getSelectedBrowserTab(state), selectedBrowserTab: getSelectedBrowserTab(state),
......
...@@ -15,11 +15,11 @@ import styles from './BrowserGenomeSelector.scss'; ...@@ -15,11 +15,11 @@ import styles from './BrowserGenomeSelector.scss';
import { getChrLocationStr } from '../browserHelper'; import { getChrLocationStr } from '../browserHelper';
type BrowserGenomeSelectorProps = { type BrowserGenomeSelectorProps = {
activeGenomeId: string; activeGenomeId: string | null;
browserActivated: boolean; browserActivated: boolean;
chrLocation: ChrLocation; chrLocation: ChrLocation;
dispatchBrowserLocation: (genomeId: string, chrLocation: ChrLocation) => void; dispatchBrowserLocation: (genomeId: string, chrLocation: ChrLocation) => void;
drawerOpened: { [genomeId: string]: boolean }; isDrawerOpened: boolean;
genomeSelectorActive: boolean; genomeSelectorActive: boolean;
toggleGenomeSelector: (genomeSelectorActive: boolean) => void; toggleGenomeSelector: (genomeSelectorActive: boolean) => void;
}; };
...@@ -27,7 +27,7 @@ type BrowserGenomeSelectorProps = { ...@@ -27,7 +27,7 @@ type BrowserGenomeSelectorProps = {
const BrowserGenomeSelector: FunctionComponent<BrowserGenomeSelectorProps> = ( const BrowserGenomeSelector: FunctionComponent<BrowserGenomeSelectorProps> = (
props: BrowserGenomeSelectorProps props: BrowserGenomeSelectorProps
) => { ) => {
const { activeGenomeId, chrLocation, drawerOpened } = props; const { activeGenomeId, chrLocation, isDrawerOpened } = props;
const chrLocationStr = getChrLocationStr(chrLocation); const chrLocationStr = getChrLocationStr(chrLocation);
const [chrLocationPlaceholder, setChrLocationPlaceholder] = useState(''); const [chrLocationPlaceholder, setChrLocationPlaceholder] = useState('');
...@@ -36,8 +36,6 @@ const BrowserGenomeSelector: FunctionComponent<BrowserGenomeSelectorProps> = ( ...@@ -36,8 +36,6 @@ const BrowserGenomeSelector: FunctionComponent<BrowserGenomeSelectorProps> = (
const [chrCode, chrStart, chrEnd] = chrLocation; const [chrCode, chrStart, chrEnd] = chrLocation;
const displayChrRegion = !(chrStart === 0 && chrEnd === 0); const displayChrRegion = !(chrStart === 0 && chrEnd === 0);
const drawerOpenedForGenome = drawerOpened[activeGenomeId];
useEffect(() => { useEffect(() => {
setChrLocationPlaceholder(chrLocationStr); setChrLocationPlaceholder(chrLocationStr);
}, []); }, []);
...@@ -45,7 +43,7 @@ const BrowserGenomeSelector: FunctionComponent<BrowserGenomeSelectorProps> = ( ...@@ -45,7 +43,7 @@ const BrowserGenomeSelector: FunctionComponent<BrowserGenomeSelectorProps> = (
const getGenomeSelectorClasses = () => { const getGenomeSelectorClasses = () => {
let classNames = styles.browserGenomeSelector; let classNames = styles.browserGenomeSelector;
if (drawerOpenedForGenome === true) { if (isDrawerOpened) {
classNames += ` ${styles.browserGenomeSelectorDisabled}`; classNames += ` ${styles.browserGenomeSelectorDisabled}`;
} }
...@@ -53,7 +51,7 @@ const BrowserGenomeSelector: FunctionComponent<BrowserGenomeSelectorProps> = ( ...@@ -53,7 +51,7 @@ const BrowserGenomeSelector: FunctionComponent<BrowserGenomeSelectorProps> = (
}; };
const activateForm = () => { const activateForm = () => {
if (drawerOpenedForGenome === true) { if (isDrawerOpened) {
return; return;
} }
......
...@@ -10,11 +10,11 @@ import styles from './BrowserReset.scss'; ...@@ -10,11 +10,11 @@ import styles from './BrowserReset.scss';
import { getChrLocationStr } from '../browserHelper'; import { getChrLocationStr } from '../browserHelper';
type BrowserResetProps = { type BrowserResetProps = {
activeGenomeId: string; activeGenomeId: string | null;
chrLocation: ChrLocation | null; chrLocation: ChrLocation | null;
defaultChrLocation: ChrLocation | null; defaultChrLocation: ChrLocation | null;
dispatchBrowserLocation: (genomeId: string, chrLocation: ChrLocation) => void; dispatchBrowserLocation: (genomeId: string, chrLocation: ChrLocation) => void;
drawerOpened: { [genomeId: string]: boolean }; isDrawerOpened: boolean;
}; };
export const BrowserReset: FunctionComponent<BrowserResetProps> = ( export const BrowserReset: FunctionComponent<BrowserResetProps> = (
...@@ -24,11 +24,9 @@ export const BrowserReset: FunctionComponent<BrowserResetProps> = ( ...@@ -24,11 +24,9 @@ export const BrowserReset: FunctionComponent<BrowserResetProps> = (
activeGenomeId, activeGenomeId,
chrLocation, chrLocation,
defaultChrLocation, defaultChrLocation,
drawerOpened isDrawerOpened
} = props; } = props;
const drawerOpenedForGenome = drawerOpened[activeGenomeId];
const getResetIconStatus = (): ImageButtonStatus => { const getResetIconStatus = (): ImageButtonStatus => {
if (!(activeGenomeId && chrLocation && defaultChrLocation)) { if (!(activeGenomeId && chrLocation && defaultChrLocation)) {
return ImageButtonStatus.DISABLED; return ImageButtonStatus.DISABLED;
...@@ -37,10 +35,7 @@ export const BrowserReset: FunctionComponent<BrowserResetProps> = ( ...@@ -37,10 +35,7 @@ export const BrowserReset: FunctionComponent<BrowserResetProps> = (
const chrLocationStr = getChrLocationStr(chrLocation); const chrLocationStr = getChrLocationStr(chrLocation);
const defaultChrLocationStr = getChrLocationStr(defaultChrLocation); const defaultChrLocationStr = getChrLocationStr(defaultChrLocation);
if ( if (chrLocationStr === defaultChrLocationStr || isDrawerOpened) {
chrLocationStr === defaultChrLocationStr ||
drawerOpenedForGenome === true
) {
return ImageButtonStatus.DISABLED; return ImageButtonStatus.DISABLED;
} }
...@@ -48,7 +43,7 @@ export const BrowserReset: FunctionComponent<BrowserResetProps> = ( ...@@ -48,7 +43,7 @@ export const BrowserReset: FunctionComponent<BrowserResetProps> = (
}; };
const resetBrowser = () => { const resetBrowser = () => {
if (drawerOpenedForGenome === true) { if (isDrawerOpened) {
return; return;
} }
......
...@@ -5,27 +5,24 @@ import { EnsObject } from 'src/ens-object/ensObjectTypes'; ...@@ -5,27 +5,24 @@ import { EnsObject } from 'src/ens-object/ensObjectTypes';
import styles from './BrowserTabs.scss'; import styles from './BrowserTabs.scss';
type BrowserTabsProps = { type BrowserTabsProps = {
activeGenomeId: string;
ensObject: EnsObject; ensObject: EnsObject;
drawerOpened: { [genomeId: string]: boolean }; isDrawerOpened: boolean;
genomeSelectorActive: boolean; genomeSelectorActive: boolean;
selectBrowserTabAndSave: (selectedBrowserTab: TrackType) => void; selectBrowserTabAndSave: (selectedBrowserTab: TrackType) => void;
selectedBrowserTab: { [genomeId: string]: TrackType }; selectedBrowserTab: TrackType;
toggleDrawer: (drawerOpened: boolean) => void; toggleDrawer: (isDrawerOpened: boolean) => void;
trackPanelModalOpened: boolean; trackPanelModalOpened: boolean;
}; };
const BrowserTabs: FunctionComponent<BrowserTabsProps> = ( const BrowserTabs: FunctionComponent<BrowserTabsProps> = (
props: BrowserTabsProps props: BrowserTabsProps
) => { ) => {
const drawerOpenedForGenome = props.drawerOpened[props.activeGenomeId];
const handleTabClick = (value: TrackType) => { const handleTabClick = (value: TrackType) => {
if (props.genomeSelectorActive || !props.ensObject.genome_id) { if (props.genomeSelectorActive || !props.ensObject.genome_id) {
return; return;
} }
if (drawerOpenedForGenome === true) { if (props.isDrawerOpened) {
props.toggleDrawer(false); props.toggleDrawer(false);
} }
...@@ -33,15 +30,13 @@ const BrowserTabs: FunctionComponent<BrowserTabsProps> = ( ...@@ -33,15 +30,13 @@ const BrowserTabs: FunctionComponent<BrowserTabsProps> = (
}; };
const getBrowserTabClasses = (trackType: TrackType) => { const getBrowserTabClasses = (trackType: TrackType) => {
const { activeGenomeId, drawerOpened, trackPanelModalOpened } = props; const { isDrawerOpened, selectedBrowserTab, trackPanelModalOpened } = props;
const selectedBrowserTab =
props.selectedBrowserTab[activeGenomeId] || TrackType.GENOMIC;
let classNames = styles.browserTab; let classNames = styles.browserTab;
if ( if (
props.ensObject.genome_id && props.ensObject.genome_id &&
selectedBrowserTab === trackType && selectedBrowserTab === trackType &&
drawerOpened[activeGenomeId] === false && isDrawerOpened === false &&
trackPanelModalOpened === false trackPanelModalOpened === false
) { ) {
classNames += ` ${styles.browserTabActive} ${styles.browserTabArrow}`; classNames += ` ${styles.browserTabActive} ${styles.browserTabArrow}`;
......
...@@ -15,7 +15,7 @@ export const getBrowserActivated = (state: RootState): boolean => ...@@ -15,7 +15,7 @@ export const getBrowserActivated = (state: RootState): boolean =>
export const getBrowserOpenState = (state: RootState): BrowserOpenState => export const getBrowserOpenState = (state: RootState): BrowserOpenState =>
state.browser.browserInfo.browserOpenState; state.browser.browserInfo.browserOpenState;
export const getBrowserActiveGenomeId = (state: RootState): string => export const getBrowserActiveGenomeId = (state: RootState) =>
state.browser.browserEntity.activeGenomeId; state.browser.browserEntity.activeGenomeId;
export const getBrowserActiveGenomeInfo = (state: RootState) => { export const getBrowserActiveGenomeInfo = (state: RootState) => {
......
...@@ -42,7 +42,7 @@ export const defaultBrowserState: BrowserState = { ...@@ -42,7 +42,7 @@ export const defaultBrowserState: BrowserState = {
}; };
export type BrowserEntityState = Readonly<{ export type BrowserEntityState = Readonly<{
activeGenomeId: string; activeGenomeId: string | null;
activeEnsObjectIds: { [genomeId: string]: string }; activeEnsObjectIds: { [genomeId: string]: string };
trackStates: TrackStates; trackStates: TrackStates;
}>; }>;
......
...@@ -4,10 +4,7 @@ import { connect } from 'react-redux'; ...@@ -4,10 +4,7 @@ import { connect } from 'react-redux';
import { RootState } from 'src/store'; import { RootState } from 'src/store';
import { toggleDrawer } from './drawerActions'; import { toggleDrawer } from './drawerActions';
import { getDrawerView } from './drawerSelectors'; import { getDrawerView } from './drawerSelectors';
import { import { getBrowserActiveEnsObject } from '../browserSelectors';
getBrowserActiveEnsObject,
getBrowserActiveGenomeId
} from '../browserSelectors';
import DrawerGene from './drawer-views/DrawerGene'; import DrawerGene from './drawer-views/DrawerGene';
import DrawerTranscript from './drawer-views/DrawerTranscript'; import DrawerTranscript from './drawer-views/DrawerTranscript';
...@@ -24,13 +21,12 @@ import SnpIndels from './drawer-views/SnpIndels'; ...@@ -24,13 +21,12 @@ import SnpIndels from './drawer-views/SnpIndels';
import { EnsObject } from 'src/ens-object/ensObjectTypes'; import { EnsObject } from 'src/ens-object/ensObjectTypes';
type StateProps = { type StateProps = {
activeGenomeId: string; drawerView: string;