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

CapsuleRepository.php

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: '',
    };