onboardingPanel.tsx 1.3 KB

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