diffModal.tsx 876 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import {css} from '@emotion/react';
  2. import type {ModalRenderProps} from 'sentry/actionCreators/modal';
  3. import IssueDiff from 'sentry/components/issueDiff';
  4. import useOrganization from 'sentry/utils/useOrganization';
  5. type Props = ModalRenderProps & React.ComponentProps<typeof IssueDiff>;
  6. function DiffModal({className, Body, CloseButton, ...props}: Props) {
  7. const organization = useOrganization();
  8. return (
  9. <Body>
  10. <CloseButton />
  11. <IssueDiff className={className} organization={organization} {...props} />
  12. </Body>
  13. );
  14. }
  15. const modalCss = css`
  16. position: absolute;
  17. left: 20px;
  18. right: 20px;
  19. top: 20px;
  20. bottom: 20px;
  21. display: flex;
  22. padding: 0;
  23. width: auto;
  24. [role='document'] {
  25. height: 100%;
  26. display: flex;
  27. flex: 1;
  28. }
  29. section {
  30. display: flex;
  31. width: 100%;
  32. }
  33. `;
  34. export {modalCss};
  35. export default DiffModal;