1234567891011121314151617181920212223242526 |
- import styled from '@emotion/styled';
- import LoadingMask, {LoadingMaskProps} from 'sentry/components/loadingMask';
- interface TransparentLoadingMaskProps extends LoadingMaskProps {
- visible: boolean;
- children?: React.ReactNode;
- className?: string;
- }
- const TransparentLoadingMask = styled(
- ({className, visible, children, ...props}: TransparentLoadingMaskProps) => {
- const other = visible ? {...props, 'data-test-id': 'loading-placeholder'} : props;
- return (
- <LoadingMask className={className} {...other}>
- {children}
- </LoadingMask>
- );
- }
- )<TransparentLoadingMaskProps>`
- ${p => !p.visible && 'display: none;'};
- opacity: 0.4;
- z-index: 1;
- `;
- export default TransparentLoadingMask;
|