traceUXChangeBanner.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import Alert from 'sentry/components/alert';
  2. import {Button} from 'sentry/components/button';
  3. import ExternalLink from 'sentry/components/links/externalLink';
  4. import {IconClose} from 'sentry/icons';
  5. import {t, tct} from 'sentry/locale';
  6. import {useLocalStorageState} from 'sentry/utils/useLocalStorageState';
  7. export function TraceUXChangeAlert() {
  8. const [dismiss, setDismissed] = useLocalStorageState('trace-view-dismissed', false);
  9. if (dismiss) {
  10. return null;
  11. }
  12. return (
  13. <Alert
  14. type="info"
  15. system
  16. trailingItems={
  17. <Button
  18. aria-label={t('dismiss')}
  19. priority="link"
  20. size="xs"
  21. icon={<IconClose />}
  22. onClick={() => setDismissed(true)}
  23. />
  24. }
  25. >
  26. {tct(
  27. 'Get deeper context with the new trace view, which links events directly inside traces. Read [why] we are doing this and how it helps you.',
  28. {
  29. why: (
  30. <ExternalLink href="https://docs.sentry.io/product/sentry-basics/concepts/tracing/trace-view/">
  31. {t('why')}
  32. </ExternalLink>
  33. ),
  34. }
  35. )}
  36. </Alert>
  37. );
  38. }