Skip to content
Snippets Groups Projects
Select Git revision
  • c2edb3b35a846c531c8b376db5fba65be7d7c17b
  • mui5-annotation-on-video-stable default
  • get_setter_canvasSizeInformations
  • fix-error-div-into-p
  • annotation-on-video-v2
  • detached
  • annotation-on-video-r17
  • mui5
  • mui5-react-18
  • jacob-test
  • annotation-on-video protected
  • master
  • test-antoinev1
  • 20-fetch-thumbnail-on-annotation
  • add-research-field
  • Save
  • add-plugin
  • 14-wip-no-seek-to
  • 14-bug-on-video-time-control
  • 9_wip_videotests
  • _upgrade_material_ui
  • latest-tetras-16
  • v3.3.0
  • v3.2.0
  • v3.1.1
  • v3.1.0
  • v3.0.0
  • v3.0.0-rc.7
  • v3.0.0-rc.6
  • v3.0.0-rc.5
  • v3.0.0-rc.4
  • v3.0.0-rc.3
  • v3.0.0-rc.2
  • v3.0.0-rc.1
  • v3.0.0-beta.10
  • v3.0.0-beta.9
  • v3.0.0-beta.8
  • v3.0.0-beta.7
  • v3.0.0-beta.6
  • v3.0.0-beta.5
  • v3.0.0-beta.3
41 results

babel.config.js

Blame
  • WindowSideBarCanvasPanel.js 2.52 KiB
    import { compose } from 'redux';
    import { connect } from 'react-redux';
    import { withTranslation } from 'react-i18next';
    import { withStyles } from '@material-ui/core/styles';
    import { withPlugins } from '../extend/withPlugins';
    import * as actions from '../state/actions';
    import { WindowSideBarCanvasPanel } from '../components/WindowSideBarCanvasPanel';
    import {
      getCompanionWindow,
      getDefaultSidebarVariant,
      getSequenceTreeStructure,
      getWindow,
      getManifestoInstance,
      getSequence,
      getSequences,
    } from '../state/selectors';
    
    /**
     * mapStateToProps - to hook up connect
     */
    const mapStateToProps = (state, { id, windowId }) => {
      const treeStructure = getSequenceTreeStructure(state, { windowId });
      const window = getWindow(state, { windowId });
      const { config } = state;
      const companionWindow = getCompanionWindow(state, { companionWindowId: id });
      const collectionPath = window.collectionPath || [];
      const collectionId = collectionPath && collectionPath[collectionPath.length - 1];
      return {
        collection: collectionId && getManifestoInstance(state, { manifestId: collectionId }),
        config,
        sequenceId: getSequence(state, { windowId }).id,
        sequences: getSequences(state, { windowId }),
        showToc: treeStructure && treeStructure.nodes && treeStructure.nodes.length > 0,
        variant: companionWindow.variant || getDefaultSidebarVariant(state, { windowId }),
      };
    };
    
    /**
     * mapStateToProps - used to hook up connect to state
     * @memberof WindowSideBarCanvasPanel
     * @private
     */
    const mapDispatchToProps = (dispatch, { id, windowId }) => ({
      showMultipart: () => dispatch(
        actions.addOrUpdateCompanionWindow(windowId, { content: 'collection', position: 'right' }),
      ),
      updateSequence: sequenceId => dispatch(
        actions.updateWindow(windowId, { sequenceId }),
      ),
      updateVariant: variant => dispatch(
        actions.updateCompanionWindow(windowId, id, { variant }),
      ),
    });
    
    /**
     *
     * @param theme
     */
    const styles = theme => ({
      break: {
        flexBasis: '100%',
        height: 0,
      },
      collectionNavigationButton: {
        textTransform: 'none',
      },
      label: {
        paddingLeft: theme.spacing(1),
      },
      select: {
        '&:focus': {
          backgroundColor: theme.palette.background.paper,
        },
      },
      selectEmpty: {
        backgroundColor: theme.palette.background.paper,
      },
      variantTab: {
        minWidth: 'auto',
      },
    });
    
    const enhance = compose(
      withTranslation(),
      withStyles(styles),
      connect(mapStateToProps, mapDispatchToProps),
      withPlugins('WindowSideBarCanvasPanel'),
    );
    
    export default enhance(WindowSideBarCanvasPanel);