Commit 8f5c2952 authored by Andrey Azov's avatar Andrey Azov
Browse files

Fix types

parent 6c3563b2
......@@ -14,7 +14,7 @@ import PrivacyBanner from './shared/privacy-banner/PrivacyBanner';
import { updateBreakpointWidth } from './globalActions';
import { getBreakpointWidth } from './globalSelectors';
import { RootState } from './rootReducer';
import { RootState } from './store';
import { BreakpointWidth, getBreakpoint } from './globalConfig';
import styles from './Root.scss';
......
......@@ -3,7 +3,7 @@ import { Route, withRouter } from 'react-router-dom';
import { RouteComponentProps } from 'react-router';
import { connect } from 'react-redux';
import { RootState } from '../rootReducer';
import { RootState } from '../store';
import { getLaunchbarExpanded } from '../header/headerSelectors';
import Home from './home/Home';
......
......@@ -15,7 +15,7 @@ import { connect } from 'react-redux';
import { changeCurrentApp } from 'src/header/headerActions';
import { getCurrentApp } from 'src/header/headerSelectors';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import AppBar from './AppBar';
......
......@@ -16,7 +16,7 @@ import BrowserNavBar from './browser-nav/BrowserNavBar';
import TrackPanel from './track-panel/TrackPanel';
import Drawer from './drawer/Drawer';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import {
BrowserOpenState,
BrowserNavStates,
......
......@@ -14,7 +14,7 @@ import {
updateCogTrackList,
updateSelectedCog
} from './browserActions';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import { CogList } from './browserState';
import {
getBrowserActivated,
......
......@@ -22,7 +22,7 @@ import {
getObjectInfo,
getTrackPanelModalOpened
} from '../browserSelectors';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import BrowserReset from '../browser-reset/BrowserReset';
import BrowserGenomeSelector from '../browser-genome-selector/BrowserGenomeSelector';
......
......@@ -21,7 +21,7 @@ import {
updateChrLocation,
updateBrowserActivated
} from '../browserActions';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
type StateProps = {
browserCogTrackList: CogList;
......
......@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { browserNavConfig, BrowserNavItem } from '../browserConfig';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import { getBrowserNavStates } from '../browserSelectors';
import { BrowserNavStates } from '../browserState';
......
......@@ -23,7 +23,7 @@ import trackHeightBtn from 'static/img/browser/icon_tracks_height_grey.svg';
import trackLockBtn from 'static/img/browser/icon_tracks_lock_open_grey.svg';
import trackHighlightBtn from 'static/img/browser/icon_tracks_highlight_grey.svg';
import trackMoveBtn from 'static/img/browser/icon_tracks_move_grey.svg';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import { CogList } from '../browserState';
type StateProps = {
......
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import {
BrowserOpenState,
BrowserNavStates,
......
import React, { FunctionComponent } from 'react';
import { connect } from 'react-redux';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import { toggleDrawer } from '../browserActions';
import { getDrawerView, getObjectInfo } from '../browserSelectors';
......
......@@ -10,7 +10,7 @@ import TrackPanelBar from './track-panel-bar/TrackPanelBar';
import TrackPanelList from './track-panel-list/TrackPanelList';
import TrackPanelModal from './track-panel-modal/TrackPanelModal';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import {
toggleDrawer,
......
......@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
import styles from './Home.scss';
import { fetchExampleObjectsData } from '../app/browser/browserActions';
import { getExampleObjects } from '../app/browser/browserSelectors';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
type StateProps = {
exampleObjects: {};
......
import { RootState } from './rootReducer';
import { RootState } from './store';
import { BreakpointWidth } from './globalConfig';
export const getBreakpointWidth = (state: RootState): BreakpointWidth =>
......
......@@ -2,7 +2,7 @@ import React, { FunctionComponent, ReactNode } from 'react';
import SlideDown from 'react-slidedown';
import { connect } from 'react-redux';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import { getAccountExpanded } from '../headerSelectors';
import styles from './Account.scss';
......
import { RootState } from '../rootReducer';
import { RootState } from '../store';
export const getAccountExpanded = (state: RootState): boolean =>
state.header.accountExpanded;
......
import React, { FunctionComponent, memo } from 'react';
import { connect } from 'react-redux';
import { RootState } from 'src/rootReducer';
import { RootState } from 'src/store';
import { changeCurrentApp } from '../headerActions';
import Launchbar from './Launchbar';
import { getCurrentApp, getLaunchbarExpanded } from '../headerSelectors';
......
......@@ -3,7 +3,9 @@ import thunk from 'redux-thunk';
import { composeWithDevTools } from 'redux-devtools-extension';
import { createBrowserHistory } from 'history';
import { routerMiddleware, LOCATION_CHANGE } from 'connected-react-router';
import rootReducer from './rootReducer';
import { StateType } from 'typesafe-actions';
import createRootReducer from './rootReducer';
import GoogleAnalyticsTracking from './services/analytics-service';
......@@ -34,9 +36,13 @@ const googleAnalyticsMiddleWare = (store: any) => (next: any) => (
export const history = createBrowserHistory();
const composeEnhancers = composeWithDevTools({});
const rootReducer = createRootReducer(history);
export type RootState = StateType<typeof rootReducer>;
export default function configureStore(preloadedState?: any) {
const store = createStore(
rootReducer(history), // root reducer with router state
rootReducer,
preloadedState,
composeEnhancers(
applyMiddleware(
......
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