Skip to content
Snippets Groups Projects
Select Git revision
  • fc7ff813de35de35ff29290b7d51dd60f6e5a5a6
  • main default protected
  • 24-everything-from-git
  • 45-create-new-poc-deployment-with-docker
  • 44-add-a-cli-tool
  • improve-deployment
  • 31-backend
  • bash-script-bug-fix
  • upgrades_submodules
  • 24-dependencies-build-nested-watch
  • 24-dependencies-build-using-workspaces
  • 24-dependencies-build
  • wip-all-local
  • 10-annotot
  • 3-annotation-plugin-showing-up
15 results

webpack.config.js

Blame
  • WorkspaceElasticWindow.js 1.28 KiB
    import { compose } from 'redux';
    import { connect } from 'react-redux';
    import { withStyles } from '@material-ui/core';
    import * as actions from '../state/actions';
    import WorkspaceElasticWindow from '../components/WorkspaceElasticWindow';
    import {
      selectCompanionWindowDimensions, getWorkspace, isFocused,
      getElasticLayout,
    } from '../state/selectors';
    
    /**
     * mapStateToProps - to hook up connect
     * @memberof Workspace
     * @private
     */
    const mapStateToProps = (state, { windowId }) => (
      {
        companionWindowDimensions: selectCompanionWindowDimensions(state, { windowId }),
        focused: isFocused(state, { windowId }),
        layout: getElasticLayout(state)[windowId],
        workspace: getWorkspace(state),
      }
    );
    
    /**
     * mapDispatchToProps - used to hook up connect to action creators
     * @memberof Workspace
     * @private
     */
    const mapDispatchToProps = (dispatch, props) => ({
      updateElasticWindowLayout: (windowId, position) => {
        dispatch(
          actions.updateElasticWindowLayout(windowId, position),
        );
      },
    });
    
    /**
     * @param theme
     */
    const styles = theme => ({
      focused: {
        zIndex: theme.zIndex.modal - 1,
      },
    });
    
    const enhance = compose(
      withStyles(styles),
      connect(mapStateToProps, mapDispatchToProps),
      // further HOC go here
    );
    
    export default enhance(WorkspaceElasticWindow);