Browse Source

ref: Move <Redirect> into components/ (#71966)

It's a component, so it should be with other jsx type things.
Ryan Albrecht 9 months ago
parent
commit
915995e042

+ 1 - 1
static/app/utils/redirect.tsx → static/app/components/redirect.tsx

@@ -1,7 +1,7 @@
 import {useEffect} from 'react';
 import type {InjectedRouter} from 'react-router';
 
-import {useNavigate} from './useNavigate';
+import {useNavigate} from 'sentry/utils/useNavigate';
 
 type Props = {
   to: string;

+ 1 - 1
static/app/utils/withDomainRedirect.tsx

@@ -3,8 +3,8 @@ import {formatPattern} from 'react-router';
 import trimEnd from 'lodash/trimEnd';
 import trimStart from 'lodash/trimStart';
 
+import Redirect from 'sentry/components/redirect';
 import recreateRoute from 'sentry/utils/recreateRoute';
-import Redirect from 'sentry/utils/redirect';
 import {normalizeUrl} from 'sentry/utils/withDomainRequired';
 
 import useOrganization from './useOrganization';

+ 1 - 1
static/app/views/onboarding/onboarding.tsx

@@ -14,6 +14,7 @@ import Link from 'sentry/components/links/link';
 import LogoSentry from 'sentry/components/logoSentry';
 import {OnboardingContext} from 'sentry/components/onboarding/onboardingContext';
 import {useRecentCreatedProject} from 'sentry/components/onboarding/useRecentCreatedProject';
+import Redirect from 'sentry/components/redirect';
 import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
 import categoryList from 'sentry/data/platformPickerCategories';
 import platforms from 'sentry/data/platforms';
@@ -24,7 +25,6 @@ import type {OnboardingSelectedSDK} from 'sentry/types/onboarding';
 import {defined} from 'sentry/utils';
 import {trackAnalytics} from 'sentry/utils/analytics';
 import {handleXhrErrorResponse} from 'sentry/utils/handleXhrErrorResponse';
-import Redirect from 'sentry/utils/redirect';
 import testableTransition from 'sentry/utils/testableTransition';
 import useApi from 'sentry/utils/useApi';
 import useOrganization from 'sentry/utils/useOrganization';

+ 1 - 1
static/app/views/projects/redirectDeprecatedProjectRoute.tsx

@@ -6,12 +6,12 @@ import type {Client, ResponseMeta} from 'sentry/api';
 import {Alert} from 'sentry/components/alert';
 import LoadingError from 'sentry/components/loadingError';
 import LoadingIndicator from 'sentry/components/loadingIndicator';
+import Redirect from 'sentry/components/redirect';
 import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
 import type {Project} from 'sentry/types/project';
 import {trackAnalytics} from 'sentry/utils/analytics';
 import getRouteStringFromRoutes from 'sentry/utils/getRouteStringFromRoutes';
-import Redirect from 'sentry/utils/redirect';
 import withApi from 'sentry/utils/withApi';
 
 type DetailsProps = {

+ 1 - 1
static/app/views/relocation/relocation.tsx

@@ -9,13 +9,13 @@ import {Button} from 'sentry/components/button';
 import LoadingError from 'sentry/components/loadingError';
 import LoadingIndicator from 'sentry/components/loadingIndicator';
 import LogoSentry from 'sentry/components/logoSentry';
+import Redirect from 'sentry/components/redirect';
 import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
 import {IconArrow} from 'sentry/icons';
 import {t} from 'sentry/locale';
 import ConfigStore from 'sentry/stores/configStore';
 import {space} from 'sentry/styles/space';
 import {browserHistory} from 'sentry/utils/browserHistory';
-import Redirect from 'sentry/utils/redirect';
 import testableTransition from 'sentry/utils/testableTransition';
 import useApi from 'sentry/utils/useApi';
 import {useSessionStorage} from 'sentry/utils/useSessionStorage';