File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed
Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 1- import React , { lazy , Suspense } from 'react' ;
21import { Route , Switch } from 'react-router-dom' ;
3- import { Loading } from 'src/components/Loading' ;
4- const NotFoundPage = lazy ( ( ) => import ( 'src/pages/ErrorPages/404Pages' ) ) ;
2+ import { NotFoundPage } from 'src/pages/ErrorPages/404Pages' ;
53export const ErrorRoutes = ( ) => {
64 return (
75 < Switch >
8- < Route
9- component = { ( ) => (
10- < Suspense fallback = { < Loading /> } >
11- < NotFoundPage />
12- </ Suspense >
13- ) }
14- />
6+ < Route component = { NotFoundPage } /> ;
157 </ Switch >
168 ) ;
179} ;
Original file line number Diff line number Diff line change @@ -3,14 +3,15 @@ import { Switch } from 'react-router-dom';
33import { PATH } from 'src/constants/paths' ;
44import { Loading } from 'src/components/Loading' ;
55import { AuthenticatedGuard } from 'src/guards/AuthenticatedGuard' ;
6+ import { ErrorRoutes } from './ErrorRoutes' ;
67const ProductList = lazy (
78 ( ) => import ( 'src/pages/ProductPages/ProductListPage' ) ,
89) ;
910const ProductItem = lazy (
1011 ( ) => import ( 'src/pages/ProductPages/ProductItemPage' ) ,
1112) ;
1213
13- export const AuthRoutes = ( ) => {
14+ export const ProductRoutes = ( ) => {
1415 return (
1516 < Switch >
1617 < AuthenticatedGuard
@@ -24,13 +25,14 @@ export const AuthRoutes = () => {
2425 />
2526 < AuthenticatedGuard
2627 exact
27- path = "/products/ :id"
28+ path = { PATH . PRODUCTS + '/ :id' }
2829 component = { ( ) => (
2930 < Suspense fallback = { < Loading /> } >
3031 < ProductItem />
3132 </ Suspense >
3233 ) }
3334 />
35+ < ErrorRoutes />
3436 </ Switch >
3537 ) ;
3638} ;
Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ import React from 'react';
22import { BrowserRouter } from 'react-router-dom' ;
33import { StaticPageRoutes } from './StaticPageRoutes' ;
44import { AuthRoutes } from './AuthRoutes' ;
5- import { ErrorRoutes } from './ErrorRoutes ' ;
5+ import { ProductRoutes } from './ProductRoutes ' ;
66
77export const Routes = ( ) => {
88 return (
99 < BrowserRouter >
1010 < StaticPageRoutes />
1111 < AuthRoutes />
12- < ErrorRoutes />
12+ < ProductRoutes />
1313 </ BrowserRouter >
1414 ) ;
1515} ;
You can’t perform that action at this time.
0 commit comments