Commit f91b7d0d authored by Imran Salam's avatar Imran Salam
Browse files

add state related to track panel modal to reducers/actions

parent 74bb665c
......@@ -57,3 +57,14 @@ export const updateDefaultChrLocation = createAction(
return (chrLocation: ChrLocation) => resolve(chrLocation);
}
);
export const openTrackPanelModal = createAction(
'browser/open-track-panel-modal',
(resolve) => {
return (trackPanelModalView: string) => resolve(trackPanelModalView);
}
);
export const closeTrackPanelModal = createAction(
'browser/close-track-panel-modal'
);
......@@ -42,6 +42,18 @@ export default (
chrLocation: action.payload,
defaultChrLocation: action.payload
};
case getType(browser.openTrackPanelModal):
return {
...state,
trackPanelModalOpened: true,
trackPanelModalView: action.payload
};
case getType(browser.closeTrackPanelModal):
return {
...state,
trackPanelModalOpened: false,
trackPanelModalView: ''
};
default:
return state;
}
......
......@@ -38,3 +38,9 @@ export const getChrLocation = (state: RootState): ChrLocation =>
export const getDefaultChrLocation = (state: RootState): ChrLocation =>
state.browser.defaultChrLocation;
export const getTrackPanelModalOpened = (state: RootState): boolean =>
state.browser.trackPanelModalOpened;
export const getTrackPanelModalView = (state: RootState): string =>
state.browser.trackPanelModalView;
......@@ -29,6 +29,8 @@ export type BrowserState = Readonly<{
defaultChrLocation: ChrLocation;
drawerOpened: boolean;
drawerSections: DrawerSection[];
trackPanelModalOpened: boolean;
trackPanelModalView: string;
trackPanelOpened: boolean;
}>;
......@@ -43,6 +45,8 @@ export const defaultState: BrowserState = {
defaultChrLocation: ['13', 0, 0],
drawerOpened: false,
drawerSections: [],
trackPanelModalOpened: false,
trackPanelModalView: '',
trackPanelOpened: true
};
......
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