replayPanel.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import styled from '@emotion/styled';
  2. import Panel from 'sentry/components/panels/panel';
  3. import {space} from 'sentry/styles/space';
  4. interface Props extends React.ComponentProps<typeof Panel> {
  5. children: React.ReactNode;
  6. image?: React.ReactNode;
  7. noCenter?: boolean;
  8. }
  9. function ReplayPanel({image, noCenter, children, ...props}: Props) {
  10. return (
  11. <Panel {...props}>
  12. <Container>
  13. {image ? <IlloBox>{image}</IlloBox> : null}
  14. <StyledBox centered={!image && !noCenter}>{children}</StyledBox>
  15. </Container>
  16. </Panel>
  17. );
  18. }
  19. const Container = styled('div')`
  20. padding: ${space(3)};
  21. position: relative;
  22. @media (min-width: ${p => p.theme.breakpoints.small}) {
  23. display: flex;
  24. align-items: flex-start;
  25. flex-direction: row;
  26. justify-content: center;
  27. flex-wrap: wrap;
  28. min-height: 300px;
  29. max-width: 1000px;
  30. margin: 0 auto;
  31. }
  32. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  33. min-height: 350px;
  34. }
  35. `;
  36. const StyledBox = styled('div')<{centered?: boolean}>`
  37. min-width: 0;
  38. z-index: 1;
  39. ${p => (p.centered ? 'text-align: center;' : '')}
  40. ${p => (p.centered ? 'max-width: 600px;' : '')}
  41. @media (min-width: ${p => p.theme.breakpoints.small}) {
  42. flex: 2;
  43. }
  44. `;
  45. const IlloBox = styled(StyledBox)`
  46. position: relative;
  47. min-height: 100px;
  48. max-width: 300px;
  49. min-width: 150px;
  50. margin: ${space(2)} auto;
  51. @media (min-width: ${p => p.theme.breakpoints.small}) {
  52. flex: 1;
  53. margin: 120px ${space(3)} ${space(3)} ${space(3)};
  54. max-width: auto;
  55. }
  56. `;
  57. export default ReplayPanel;