Skip to content
Snippets Groups Projects
Select Git revision
  • 4ad16d5d5d9e7ae08e736aedfeb89854a648baab
  • main default
  • 35-cgu
  • 34-peertube-support
  • 27-add-autoplay-to-iframe
  • 33-bug-on-youtube-embed-urls
  • 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
23 results

CapsuleGroupControllerTest.php

Blame
  • WindowThumbnailSettings.js 3.28 KiB
    import React, { Component } from 'react';
    import FormControlLabel from '@material-ui/core/FormControlLabel';
    import ListSubheader from '@material-ui/core/ListSubheader';
    import MenuItem from '@material-ui/core/MenuItem';
    import ThumbnailsOffIcon from '@material-ui/icons/CropDinSharp';
    import PropTypes from 'prop-types';
    import ThumbnailNavigationBottomIcon from './icons/ThumbnailNavigationBottomIcon';
    import ThumbnailNavigationRightIcon from './icons/ThumbnailNavigationRightIcon';
    /**
     *
     */
    export class WindowThumbnailSettings extends Component {
      /**
       * constructor -
       */
      constructor(props) {
        super(props);
        this.handleChange = this.handleChange.bind(this);
      }
    
      /**
       * @private
       */
      handleChange(value) {
        const { windowId, setWindowThumbnailPosition } = this.props;
    
        setWindowThumbnailPosition(windowId, value);
      }
    
      /**
       * render
       *
       * @return {type}  description
       */
      render() {
        const {
          classes, handleClose, t, thumbnailNavigationPosition, direction,
        } = this.props;
    
        return (
          <>
            <ListSubheader role="presentation" disableSticky tabIndex="-1">{t('thumbnails')}</ListSubheader>
    
            <MenuItem className={classes.MenuItem} onClick={() => { this.handleChange('off'); handleClose(); }}>
              <FormControlLabel
                value="off"
                classes={{ label: thumbnailNavigationPosition === 'off' ? classes.selectedLabel : classes.label }}
                control={
                  <ThumbnailsOffIcon color={thumbnailNavigationPosition === 'off' ? 'secondary' : undefined} />
                }
                label={t('off')}
                labelPlacement="bottom"
              />
            </MenuItem>
            <MenuItem className={classes.MenuItem} onClick={() => { this.handleChange('far-bottom'); handleClose(); }}>
              <FormControlLabel
                value="far-bottom"
                classes={{ label: thumbnailNavigationPosition === 'far-bottom' ? classes.selectedLabel : classes.label }}
                control={
                  <ThumbnailNavigationBottomIcon color={thumbnailNavigationPosition === 'far-bottom' ? 'secondary' : undefined} />
                }
                label={t('bottom')}
                labelPlacement="bottom"
              />
            </MenuItem>
            <MenuItem className={classes.MenuItem} onClick={() => { this.handleChange('far-right'); handleClose(); }}>
              <FormControlLabel
                value="far-right"
                classes={{ label: thumbnailNavigationPosition === 'far-right' ? classes.selectedLabel : classes.label }}
                control={(
                  <ThumbnailNavigationRightIcon
                    color={thumbnailNavigationPosition === 'far-right' ? 'secondary' : undefined}
                    style={direction === 'rtl' ? { transform: 'rotate(180deg)' } : {}}
                  />
                )}
                label={t('right')}
                labelPlacement="bottom"
              />
            </MenuItem>
          </>
        );
      }
    }
    
    WindowThumbnailSettings.propTypes = {
      classes: PropTypes.objectOf(PropTypes.string).isRequired,
      direction: PropTypes.string.isRequired,
      handleClose: PropTypes.func,
      setWindowThumbnailPosition: PropTypes.func.isRequired,
      t: PropTypes.func,
      thumbnailNavigationPosition: PropTypes.string.isRequired,
      windowId: PropTypes.string.isRequired,
    };
    WindowThumbnailSettings.defaultProps = {
      handleClose: () => {},
      t: key => key,
    };