onboardingPanel.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. {image ? <IlloBox>{image}</IlloBox> : null}
  13. <StyledBox centered={!image}>{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')<{centered?: boolean}>`
  36. z-index: 1;
  37. ${p => (p.centered ? 'text-align: center;' : '')}
  38. ${p => (p.centered ? 'max-width: 600px;' : '')}
  39. @media (min-width: ${p => p.theme.breakpoints.small}) {
  40. flex: 2;
  41. }
  42. `;
  43. const IlloBox = styled(StyledBox)`
  44. position: relative;
  45. min-height: 100px;
  46. max-width: 300px;
  47. margin: ${space(2)} auto;
  48. @media (min-width: ${p => p.theme.breakpoints.small}) {
  49. flex: 1;
  50. margin: ${space(3)};
  51. max-width: auto;
  52. }
  53. `;
  54. export default OnboardingPanel;