Skip to content
Snippets Groups Projects
Commit 2ff8081a authored by Mathias Maaß's avatar Mathias Maaß
Browse files

add mirador state getter

parent 3c62f214
No related branches found
No related tags found
No related merge requests found
...@@ -2,23 +2,23 @@ import { compose } from 'redux'; ...@@ -2,23 +2,23 @@ import { compose } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withPlugins } from '../extend/withPlugins'; import { withPlugins } from '../extend/withPlugins';
import * as actions from '../state/actions'; import * as actions from '../state/actions';
import { getTheme } from '../state/selectors'; import { getTheme, getMiradorState } from '../state/selectors';
import { App } from '../components/App'; import { App } from '../components/App';
/** /**
* mapStateToProps - to hook up connect * mapStateToProps - to hook up connect
* @memberof App * @memberof App
* @private * @private
*/ */
const mapStateToProps = state => ( function mapStateToProps(globalState) {
{ const state = getMiradorState(globalState);
return {
isFullscreenEnabled: state.workspace.isFullscreenEnabled, isFullscreenEnabled: state.workspace.isFullscreenEnabled,
language: state.config.language, language: state.config.language,
theme: getTheme(state), theme: getTheme(state),
translations: state.config.translations, translations: state.config.translations,
};
} }
);
/** /**
* mapDispatchToProps - used to hook up connect to action creators * mapDispatchToProps - used to hook up connect to action creators
......
...@@ -6,3 +6,4 @@ export * from './manifests'; ...@@ -6,3 +6,4 @@ export * from './manifests';
export * from './windows'; export * from './windows';
export * from './workspace'; export * from './workspace';
export * from './searches'; export * from './searches';
export * from './miradorState';
/** */
let _getMiradorState = globalState => globalState; // eslint-disable-line no-underscore-dangle
/** */
export function setMiradorStateGetter(customGetter) {
_getMiradorState = customGetter;
}
/** */
export function getMiradorState(globalState) {
return _getMiradorState(globalState);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment