@@ -9,24 +9,25 @@ import {t} from 'sentry/locale';
99import ConfigStore from 'sentry/stores/configStore' ;
1010import { space } from 'sentry/styles/space' ;
1111import type { RouteComponentProps } from 'sentry/types/legacyReactRouter' ;
12- import { browserHistory } from 'sentry/utils/browserHistory ' ;
12+ import { useNavigate } from 'sentry/utils/useNavigate ' ;
1313
1414import DebounceSearch from 'admin/components/debounceSearch' ;
1515import Overview from 'admin/views/overview' ;
1616
1717type Props = RouteComponentProps < unknown , unknown > ;
1818
1919function HomePage ( props : Props ) {
20+ const navigate = useNavigate ( ) ;
2021 const regions = ConfigStore . get ( 'regions' ) ;
2122 const [ oldSplash , setOldSplash ] = useState ( false ) ;
2223 const [ regionUrl , setRegionUrl ] = useState ( regions [ 0 ] ! . url ) ;
2324
2425 const buildOrgPath = ( org : any ) => `/_admin/customers/${ org . slug } /` ;
2526 const orgSelect = ( org : any ) => {
26- browserHistory . push ( buildOrgPath ( org ) ) ;
27+ navigate ( buildOrgPath ( org ) ) ;
2728 } ;
2829 const orgSubmit = ( query : string ) => {
29- browserHistory . push ( {
30+ navigate ( {
3031 pathname : '/_admin/customers/' ,
3132 query : {
3233 query,
@@ -35,10 +36,10 @@ function HomePage(props: Props) {
3536 } ;
3637 const buildUserPath = ( user : any ) => `/_admin/users/${ user . id } /` ;
3738 const userSelect = ( user : any ) => {
38- browserHistory . push ( buildUserPath ( user ) ) ;
39+ navigate ( buildUserPath ( user ) ) ;
3940 } ;
4041 const userSubmit = ( query : string ) => {
41- browserHistory . push ( {
42+ navigate ( {
4243 pathname : '/_admin/users/' ,
4344 query : {
4445 query,
@@ -48,7 +49,7 @@ function HomePage(props: Props) {
4849 const buildProjPath = ( proj : any ) =>
4950 `/_admin/customers/${ proj . organization . slug } /projects/${ proj . slug } /` ;
5051 const projSelect = ( proj : any ) => {
51- browserHistory . push ( buildProjPath ( proj ) ) ;
52+ navigate ( buildProjPath ( proj ) ) ;
5253 } ;
5354
5455 const renderOrgSuggestion = ( org : any ) => {
0 commit comments