Skip to content
Snippets Groups Projects
Select Git revision
  • a32ed7270a41f1026cae959bc0f7588f9962a04d
  • main default protected
  • export
  • 28-conversion-tests
  • extraction
  • exploration
  • exploration-old
  • 2-encoding-fix
  • main-old
9 results

activite.rq

Blame
  • ViewerInfo.js 866 B
    import { compose } from 'redux';
    import { connect } from 'react-redux';
    import { withTranslation } from 'react-i18next';
    import { ViewerInfo } from '../components/ViewerInfo';
    import { getCanvasLabel, getWindowManifest, getManifestCanvases } from '../state/selectors';
    
    /**
     * mapStateToProps - to hook up connect
     * @memberof Window
     * @private
     */
    const mapStateToProps = (state, props) => {
      const { windowId } = props;
      const manifest = getWindowManifest(state, windowId);
      const canvases = getManifestCanvases(manifest);
      const { canvasIndex } = state.windows[windowId];
    
      return {
        canvasCount: canvases.length,
        canvasIndex,
        canvasLabel: getCanvasLabel(canvases[canvasIndex], canvasIndex),
      };
    };
    
    const enhance = compose(
      withTranslation(),
      connect(mapStateToProps, null),
      // further HOC go here
    );
    
    export default enhance(ViewerInfo);