traceUXChangeBanner.tsx 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import Alert from 'sentry/components/alert';
  2. import {Button} from 'sentry/components/button';
  3. import {IconClose} from 'sentry/icons';
  4. import {t, tct} from 'sentry/locale';
  5. import {useLocalStorageState} from 'sentry/utils/useLocalStorageState';
  6. export function TraceUXChangeAlert() {
  7. const [dismiss, setDismissed] = useLocalStorageState('trace-view-dismissed', false);
  8. if (dismiss) {
  9. return null;
  10. }
  11. return (
  12. <Alert
  13. type="info"
  14. system
  15. trailingItems={
  16. <Button
  17. aria-label="dismiss"
  18. priority="link"
  19. size="xs"
  20. icon={<IconClose />}
  21. onClick={() => setDismissed(true)}
  22. />
  23. }
  24. >
  25. {tct(
  26. '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',
  27. {
  28. why: (
  29. <a href="https://docs.sentry.io/product/sentry-basics/concepts/tracing/trace-view/">
  30. {t('why')}
  31. </a>
  32. ),
  33. }
  34. )}
  35. </Alert>
  36. );
  37. }