highlightModalContainer.tsx 1003 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. `;
  30. const PositionBottomLeft = styled('img')<{width: string}>`
  31. position: absolute;
  32. width: ${p => p.width};
  33. bottom: 0;
  34. left: 0;
  35. pointer-events: none;
  36. `;
  37. HighlightModalContainer.defaultProps = {
  38. topWidth: '400px',
  39. bottomWidth: '200px',
  40. };