Skip to content
Snippets Groups Projects
Select Git revision
  • 58e6f7732254b5a40900edd927e29aec3c5be559
  • 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

ScrollIndicatedDialogContent.js

Blame
  • ScrollIndicatedDialogContent.js 1.92 KiB
    import PropTypes from 'prop-types';
    import DialogContent from '@mui/material/DialogContent';
    import { styled } from '@mui/material/styles';
    
    const Root = styled(DialogContent, { name: 'ScrollIndicatedDialogContent', slot: 'root' })(({ theme }) => ({
      /* Shadow covers */
      background: `linear-gradient(${theme.palette.background.paper} 30%, rgba(255, 255, 255, 0)), `
        + `linear-gradient(rgba(255, 255, 255, 0), ${theme.palette.background.paper} 70%) 0 100%, `
        // Shaddows
        + 'radial-gradient(50% 0, farthest-side, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)), '
        + 'radial-gradient(50% 100%, farthest-side, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%,',
      /* Shadow covers */
      background: `linear-gradient(${theme.palette.background.paper} 30%, rgba(255, 255, 255, 0)), ` // eslint-disable-line no-dupe-keys
        + `linear-gradient(rgba(255, 255, 255, 0), ${theme.palette.background.paper} 70%) 0 100%, `
        // Shaddows
        + 'radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)), '
        + 'radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%;',
    
      backgroundAttachment: 'local, local, scroll, scroll',
      backgroundRepeat: 'no-repeat',
      backgroundSize: '100% 40px, 100% 40px, 100% 14px, 100% 14px',
      overflowY: 'auto',
    }));
    
    /**
     * ScrollIndicatedDialogContent ~ Inject a style into the DialogContent component
     *                                to indicate there is scrollable content
    */
    export function ScrollIndicatedDialogContent(props) {
      const { classes, className, ...otherProps } = props;
      const ourClassName = [className, classes.shadowScrollDialog].join(' ');
    
      return (
        <Root
          className={ourClassName}
          {...otherProps}
        />
      );
    }
    
    ScrollIndicatedDialogContent.propTypes = {
      classes: PropTypes.shape({
        shadowScrollDialog: PropTypes.string,
      }),
      className: PropTypes.string,
    };
    
    ScrollIndicatedDialogContent.defaultProps = {
      classes: {},
      className: '',
    };