oldFeedbackButton.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {LinkButton} from 'sentry/components/button';
  2. import ExternalLink from 'sentry/components/links/externalLink';
  3. import {Tooltip} from 'sentry/components/tooltip';
  4. import {t, tct} from 'sentry/locale';
  5. import {useLocation} from 'sentry/utils/useLocation';
  6. import useOrganization from 'sentry/utils/useOrganization';
  7. import {normalizeUrl} from 'sentry/utils/withDomainRequired';
  8. export default function OldFeedbackButton() {
  9. const location = useLocation();
  10. const organization = useOrganization();
  11. return (
  12. <Tooltip
  13. title={tct('View [link:error-associated feedback reports].', {
  14. link: (
  15. <ExternalLink href="https://docs.sentry.io/product/user-feedback/#crash-report-modal" />
  16. ),
  17. })}
  18. position="left"
  19. isHoverable
  20. >
  21. <LinkButton
  22. analyticsEventName="Clicked Go To Old User Feedback Button"
  23. analyticsEventKey="feedback.index-old-ui-clicked"
  24. size="sm"
  25. priority="default"
  26. to={{
  27. pathname: normalizeUrl(`/organizations/${organization.slug}/user-feedback/`),
  28. query: {
  29. ...location.query,
  30. query: undefined,
  31. cursor: undefined,
  32. },
  33. }}
  34. >
  35. {t('Go to Old User Feedback')}
  36. </LinkButton>
  37. </Tooltip>
  38. );
  39. }