onboarding.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import * as React from 'react';
  2. import styled from '@emotion/styled';
  3. import emptyStateImg from 'sentry-images/spot/alerts-empty-state.svg';
  4. import ButtonBar from 'sentry/components/buttonBar';
  5. import OnboardingPanel from 'sentry/components/onboardingPanel';
  6. import {t} from 'sentry/locale';
  7. type Props = {
  8. actions: React.ReactNode;
  9. };
  10. function Onboarding({actions}: Props) {
  11. return (
  12. <OnboardingPanel image={<AlertsImage src={emptyStateImg} />}>
  13. <h3>{t('More signal, less noise')}</h3>
  14. <p>
  15. {t(
  16. 'Not every error is worth an email. Set your own rules for alerts you need, with information that helps.'
  17. )}
  18. </p>
  19. <ButtonList gap={1}>{actions}</ButtonList>
  20. </OnboardingPanel>
  21. );
  22. }
  23. const AlertsImage = styled('img')`
  24. @media (min-width: ${p => p.theme.breakpoints[0]}) {
  25. user-select: none;
  26. position: absolute;
  27. top: 0;
  28. bottom: 0;
  29. width: 220px;
  30. margin-top: auto;
  31. margin-bottom: auto;
  32. transform: translateX(-50%);
  33. left: 50%;
  34. }
  35. @media (min-width: ${p => p.theme.breakpoints[2]}) {
  36. transform: translateX(-60%);
  37. width: 280px;
  38. }
  39. @media (min-width: ${p => p.theme.breakpoints[3]}) {
  40. transform: translateX(-75%);
  41. width: 320px;
  42. }
  43. `;
  44. const ButtonList = styled(ButtonBar)`
  45. grid-template-columns: repeat(auto-fit, minmax(130px, max-content));
  46. `;
  47. export default Onboarding;