releaseFeedbackBanner.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import styled from '@emotion/styled';
  2. import replaysDeadRageBackground from 'sentry-images/spot/replay-dead-rage-changelog.svg';
  3. import {LinkButton} from 'sentry/components/button';
  4. import PageBanner from 'sentry/components/replays/pageBanner';
  5. import {IconBroadcast} from 'sentry/icons';
  6. import {t, tct} from 'sentry/locale';
  7. import useDismissAlert from 'sentry/utils/useDismissAlert';
  8. const LOCAL_STORAGE_KEY = 'release-v1-feedback-dismissed';
  9. /**
  10. * Copied from static/app/components/feedback/feedbackSetupBanner.tsx
  11. */
  12. export default function ReleaseFeedbackBanner() {
  13. const {dismiss, isDismissed} = useDismissAlert({key: LOCAL_STORAGE_KEY});
  14. const ctaButton = (
  15. <LinkButton external href="mailto:feedback-releases@sentry.io" priority="primary">
  16. {t('Email Us')}
  17. </LinkButton>
  18. );
  19. return isDismissed ? null : (
  20. <PageBanner
  21. style={{marginBottom: '16px'}}
  22. button={ctaButton}
  23. description={t('Send us an email to get early access.')}
  24. heading={t('Want to automatically rollback bad releases?')}
  25. icon={<IconBroadcast size="sm" />}
  26. image={replaysDeadRageBackground}
  27. title={tct("[blue:What's New]", {blue: <Blue />})}
  28. onDismiss={dismiss}
  29. />
  30. );
  31. }
  32. const Blue = styled('span')`
  33. color: ${p => p.theme.blue400};
  34. font-weight: bold;
  35. `;