pathnames.tsx 602 B

12345678910111213141516171819
  1. import type {Organization} from 'sentry/types/organization';
  2. import normalizeUrl from 'sentry/utils/url/normalizeUrl';
  3. const LEGACY_REPLAYS_BASE_PATHNAME = 'replays';
  4. const REPLAYS_BASE_PATHNAME = 'explore/replays';
  5. export function makeReplaysPathname({
  6. path,
  7. organization,
  8. }: {
  9. organization: Organization;
  10. path: '/' | `/${string}/`;
  11. }) {
  12. return normalizeUrl(
  13. organization.features.includes('navigation-sidebar-v2')
  14. ? `/organizations/${organization.slug}/${REPLAYS_BASE_PATHNAME}${path}`
  15. : `/organizations/${organization.slug}/${LEGACY_REPLAYS_BASE_PATHNAME}${path}`
  16. );
  17. }