Skip to content
Snippets Groups Projects
Select Git revision
  • 3b4d385149fb79466dc0eede575039ab8ee3ff9f
  • mui5-tetras-main-stable default protected
  • mui5-tetras-main-old-stable
  • preprod protected
  • 75-dernieres-ameliorations-avant-workshop-du-7-02
  • wip-fix-xywh
  • wip-positionement-annot
  • wip-surface-transformer
  • uploads-file
  • 69-la-video-demare-quand-on-fait-glisser-le-slider-et-le-clic-creer-un-decalage-entre-le-player
  • 61-recettage-des-outils-d-annotation
  • gestion_multiple_ouverture_pannel_annotation
  • autorisation_un_pannel_annotation
  • autorisation_un_pannel_edition_annotation
  • récupération_temps_video
  • save-shapes-and-position
  • fix-error-create-annotation-pannel
  • time-saving-on-annotation
  • tetras-main protected
  • fix-poc-mirador
  • tetras-antho-test
21 results

setupJest.js

Blame
  • OpenSeadragonViewer.js 1.55 KiB
    import { compose } from 'redux';
    import { connect } from 'react-redux';
    import { withTranslation } from 'react-i18next';
    import { withStyles } from '@material-ui/core';
    import { fade } from '@material-ui/core/styles/colorManipulator';
    import { OpenSeadragonViewer } from '../components/OpenSeadragonViewer';
    import * as actions from '../state/actions';
    import {
      getCanvasLabel,
      getSelectedCanvas,
      getSelectedCanvasAnnotations,
    } from '../state/selectors';
    
    /**
     * mapStateToProps - used to hook up connect to action creators
     * @memberof Window
     * @private
     */
    const mapStateToProps = ({
      viewers, windows, manifests, annotations,
    }, { windowId, currentCanvases }) => ({
      viewer: viewers[windowId],
      label: getCanvasLabel(
        getSelectedCanvas({ windows, manifests }, windowId),
        windows[windowId].canvasIndex,
      ),
      annotations: getSelectedCanvasAnnotations(
        { annotations },
        currentCanvases.map(canvas => canvas.id),
      ),
    });
    
    /**
     * mapDispatchToProps - used to hook up connect to action creators
     * @memberof ManifestListItem
     * @private
     */
    const mapDispatchToProps = {
      updateViewport: actions.updateViewport,
    };
    
    /**
     *
     * @param theme
     * @returns {{windowSideBarHeading: *}}
     */
    const styles = theme => ({
      controls: {
        width: '100%',
        position: 'absolute',
        bottom: 0,
        zIndex: 50,
        backgroundColor: fade(theme.palette.background.paper, 0.5),
      },
    });
    
    const enhance = compose(
      withStyles(styles),
      withTranslation(),
      connect(mapStateToProps, mapDispatchToProps),
      // further HOC go here
    );
    
    
    export default enhance(OpenSeadragonViewer);