Skip to content
Snippets Groups Projects
Select Git revision
  • 0f6fc43a03f4ae9ba87a1f63118133c7bbc20149
  • master default protected
  • multiprocessing
  • experiment/clara
  • experiment/spec2B-poc
  • experiment/qivalio-poc
  • experiment/ertms
  • MAY-2023
  • FEB-2023
  • EGC-2023
  • 0.2.1
  • v0.2.0
  • v0.1.2
13 results

atomic_extraction.py

Blame
  • ThumbnailCanvasGrouping.js 1.59 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 { getCurrentCanvas } from '../state/selectors';
    import { ThumbnailCanvasGrouping } from '../components/ThumbnailCanvasGrouping';
    
    /**
     * mapDispatchToProps - used to hook up connect to action creators
     * @memberof ThumbnailCanvasGrouping
     * @private
     */
    const mapDispatchToProps = (dispatch, { data }) => ({
      setCanvas: (...args) => dispatch(actions.setCanvas(data.windowId, ...args)),
    });
    
    /**
     * mapStateToProps - used to hook up state to props
     * @memberof ThumbnailCanvasGrouping
     * @private
     */
    const mapStateToProps = (state, { data }) => ({
      currentCanvasId: (getCurrentCanvas(state, { windowId: data.windowId }) || {}).id,
    });
    
    /**
     * Styles for withStyles HOC
     */
    const styles = theme => ({
      canvas: {
        '&$currentCanvas': {
          outline: `2px solid ${theme.palette.primary.main}`,
          outlineOffset: '3px',
        },
        '&:hover': {
          outline: `9px solid ${theme.palette.action.hover}`,
          outlineOffset: '-2px',
        },
        boxSizing: 'border-box',
        color: theme.palette.common.white,
        cursor: 'pointer',
        display: 'inline-block',
        outline: 0,
        whiteSpace: 'nowrap',
      },
      currentCanvas: {
      },
    });
    
    const enhance = compose(
      withTranslation(),
      withStyles(styles),
      connect(mapStateToProps, mapDispatchToProps),
      withPlugins('ThumbnailCanvasGrouping'),
    );
    
    export default enhance(ThumbnailCanvasGrouping);