highlightModalContainer.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import BottomLeft from 'sentry-images/pattern/highlight-bottom-left.svg';
  4. import TopRight from 'sentry-images/pattern/highlight-top-right.svg';
  5. type Props = {
  6. bottomWidth: string;
  7. children: React.ReactNode;
  8. topWidth: string;
  9. };
  10. export default function HighlightModalContainer({
  11. topWidth,
  12. bottomWidth,
  13. children,
  14. }: Props) {
  15. return (
  16. <Fragment>
  17. <PositionTopRight src={TopRight} width={topWidth} />
  18. {children}
  19. <PositionBottomLeft src={BottomLeft} width={bottomWidth} />
  20. </Fragment>
  21. );
  22. }
  23. const PositionTopRight = styled('img')<{width: string}>`
  24. position: absolute;
  25. width: ${p => p.width};
  26. right: 0;
  27. top: 0;
  28. pointer-events: none;
  29. border-radius: 0 ${p => p.theme.modalBorderRadius} 0 0;
  30. `;
  31. const PositionBottomLeft = styled('img')<{width: string}>`
  32. position: absolute;
  33. width: ${p => p.width};
  34. bottom: 0;
  35. left: 0;
  36. pointer-events: none;
  37. border-radius: 0 0 0 ${p => p.theme.modalBorderRadius};
  38. `;
  39. HighlightModalContainer.defaultProps = {
  40. topWidth: '400px',
  41. bottomWidth: '200px',
  42. };