feat(react): Redirecting /assets to index (#2154)

This commit is contained in:
Gabe Lyons 2021-03-02 10:52:57 -08:00 committed by GitHub
parent 11532a1cc3
commit 83cd89ad08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -35,7 +35,6 @@ export const Routes = (): JSX.Element => {
<Switch>
<ProtectedRoute isLoggedIn={isLoggedIn} exact path="/" render={() => <HomePage />} />
<Route path={PageRoutes.LOG_IN} component={LogIn} />
{entityRegistry.getEntities().map((entity) => (
<ProtectedRoute
key={entity.getPathName()}
@ -54,6 +53,8 @@ export const Routes = (): JSX.Element => {
path={PageRoutes.BROWSE_RESULTS}
render={() => <BrowseResultsPage />}
/>
{/* Starting the react app locally opens /assets by default. For a smoother dev experience, we'll redirect to the homepage */}
<Route path={PageRoutes.ASSETS} component={() => <Redirect to="/" />} exact />
<Route component={NoPageFound} />
</Switch>
</div>

View File

@ -14,4 +14,5 @@ export enum PageRoutes {
BROWSE = '/browse',
BROWSE_RESULTS = '/browse/:type',
DATASETS = '/datasets',
ASSETS = '/assets',
}