onboarding.tsx 1.3 KB

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