Skip to content
Snippets Groups Projects
Select Git revision
  • 33-bug-on-youtube-embed-urls
  • main default
  • 35-cgu
  • 34-peertube-support
  • 27-add-autoplay-to-iframe
  • RC-Rekall-v1.1-fix_lpo
  • tuleap-140-go-back-to-my-capsules-page-when-i-m-on-capsule-preview-page
  • RC-Rekall-v1.2-fix10
  • RC-Rekall-v1.2-fix9
  • RC-Rekall-v1.2-fix8
  • RC-Rekall-v1.2-fix7
  • RC-Rekall-v1.2-fix6
  • RC-Rekall-v1.2-fix5
  • RC-Rekall-v1.2-fix4
  • RC-Rekall-v1.2-fix3
  • RC-Rekall-v1.2-fix2
  • RC-Rekall-v1.2-fix1
  • RC-Rekall-v1.1-fix-3
  • RC-Rekall-v1.1-fix-2
  • RC-Rekall-v1.1-fix-1
  • RC-Rekall-v1.1-delivered
  • preprod20220209-1535
22 results

Version20211230115034.php

Blame
  • WindowCanvasNavigationControls.js 1.97 KiB
    import React, { Component } from 'react';
    import PropTypes from 'prop-types';
    import classNames from 'classnames';
    import Paper from '@material-ui/core/Paper';
    import Typography from '@material-ui/core/Typography';
    import ZoomControls from '../containers/ZoomControls';
    import ViewerInfo from '../containers/ViewerInfo';
    import ViewerNavigation from '../containers/ViewerNavigation';
    import ns from '../config/css-ns';
    
    /**
     * Represents the viewer controls in the mirador workspace.
     */
    export class WindowCanvasNavigationControls extends Component {
      /**
       * Determine if canvasNavControls are stacked (based on a hard-coded width)
      */
      canvasNavControlsAreStacked() {
        const { size } = this.props;
    
        return (size && size.width && size.width <= 253);
      }
    
      /** */
      render() {
        const {
          classes, visible, windowId, zoomToWorld,
        } = this.props;
    
        if (!visible) return (<Typography variant="srOnly" component="div"><ViewerInfo windowId={windowId} /></Typography>);
    
        return (
          <Paper
            square
            className={
              classNames(
                classes.controls,
                ns('canvas-nav'),
                classes.canvasNav,
                this.canvasNavControlsAreStacked() ? ns('canvas-nav-stacked') : null,
                this.canvasNavControlsAreStacked() ? classes.canvasNavStacked : null,
              )}
            elevation={0}
          >
            <ZoomControls
              displayDivider={!this.canvasNavControlsAreStacked()}
              windowId={windowId}
              zoomToWorld={zoomToWorld}
            />
            <ViewerNavigation windowId={windowId} />
            <ViewerInfo windowId={windowId} />
          </Paper>
        );
      }
    }
    
    
    WindowCanvasNavigationControls.propTypes = {
      classes: PropTypes.objectOf(PropTypes.string),
      size: PropTypes.shape({ width: PropTypes.number }).isRequired,
      visible: PropTypes.bool,
      windowId: PropTypes.string.isRequired,
      zoomToWorld: PropTypes.func.isRequired,
    };
    
    WindowCanvasNavigationControls.defaultProps = {
      classes: {},
      visible: true,
    };