import React, { FunctionComponent, RefObject } from 'react'; import { connect } from 'react-redux'; import { browserInfoConfig } from '../browserConfig'; import { toggleBrowserNav, updateDefaultChrLocation } from '../browserActions'; import { ChrLocation } from '../browserState'; import { getBrowserNavOpened, getChrLocation, getBrowserActivated } from '../browserSelectors'; import { RootState } from 'src/rootReducer'; import BrowserReset from '../browser-reset/BrowserReset'; import BrowserGenomeSelector from '../browser-genome-selector/BrowserGenomeSelector'; import styles from './BrowserBar.scss'; type StateProps = { browserActivated: boolean; browserNavOpened: boolean; chrLocation: ChrLocation; }; type DispatchProps = { toggleBrowserNav: () => void; updateDefaultChrLocation: (chrLocation: ChrLocation) => void; }; type OwnProps = { browserRef: RefObject; }; type BrowserBarProps = StateProps & DispatchProps & OwnProps; export const BrowserBar: FunctionComponent = ( props: BrowserBarProps ) => { const { navigator, reset } = browserInfoConfig; const browserImageEl = props.browserRef.current as HTMLDivElement; return (
BRAC2
ENSG00000139618
84,793
protein coding
forward strand
); }; const mapStateToProps = (state: RootState): StateProps => ({ browserActivated: getBrowserActivated(state), browserNavOpened: getBrowserNavOpened(state), chrLocation: getChrLocation(state) }); const mapDispatchToProps: DispatchProps = { toggleBrowserNav, updateDefaultChrLocation }; export default connect( mapStateToProps, mapDispatchToProps )(BrowserBar);