Skip to content
Snippets Groups Projects
Commit db3c2262 authored by Antoine Roy's avatar Antoine Roy
Browse files

création d'un container au plugin avec redux

parent 94593d41
No related branches found
No related tags found
No related merge requests found
Pipeline #1806 failed
import { compose } from 'redux';
import { connect } from 'react-redux';
import { getWindowViewType } from 'mirador/dist/es/src/state/selectors';
import { getVisibleCanvases } from 'mirador/dist/es/src/state/selectors/canvases';
import MiradorAnnotation from '../plugins/miradorAnnotationPlugin';
import { getCompanionWindowsForContent } from 'mirador/dist/es/src/state/selectors/companionWindows';
function mapStateToProps(state, { targetProps: { windowId } }) {
const annotationCreationCompanionWindows = getCompanionWindowsForContent(state, { content: 'annotationCreation', windowId });
let annotationEdit = true;
if (Object.keys(annotationCreationCompanionWindows).length !== 0) {
annotationEdit = false;
}
return {
canvases: getVisibleCanvases(state, { windowId }),
config: state.config,
createAnnotation: annotationEdit,
windowViewType: getWindowViewType(state, { windowId }),
}
};
const enhance = compose(
connect(mapStateToProps),
);
export default enhance(MiradorAnnotation);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment