|
@@ -1,6 +1,6 @@
|
|
|
import { lazy, Suspense } from 'react';
|
|
|
import { useSelector } from 'react-redux';
|
|
|
-import { BrowserRouter, Switch } from 'react-router-dom';
|
|
|
+import { BrowserRouter, Switch, Route } from 'react-router-dom';
|
|
|
import 'react-toastify/dist/ReactToastify.css';
|
|
|
import { ToastContainer } from 'react-toastify';
|
|
|
|
|
@@ -8,6 +8,7 @@ import Loader from './components/Loader/Loader';
|
|
|
import Navigation from './components/Navigation/Navigation';
|
|
|
import PrivateRoute from './components/Routes/PrivateRoute/PrivateRoute';
|
|
|
import PublicRoute from './components/Routes/PublicRoute/PublicRoute';
|
|
|
+
|
|
|
import { getLoad } from './redux/loading/selector/';
|
|
|
|
|
|
const Categories = lazy(() =>
|
|
@@ -100,7 +101,7 @@ function App() {
|
|
|
<PrivateRoute path="/orders/:id">
|
|
|
<DetailOrder />
|
|
|
</PrivateRoute>
|
|
|
- <PublicRoute path={'/authorization'} restricted>
|
|
|
+ <Route path={'/authorization'}>
|
|
|
<Authorization />
|
|
|
<PublicRoute exact path={'/authorization/login'} restricted>
|
|
|
<SignInForm />
|
|
@@ -108,7 +109,7 @@ function App() {
|
|
|
<PublicRoute exact path={'/authorization/registration'} restricted>
|
|
|
<RegistrationForm />
|
|
|
</PublicRoute>
|
|
|
- </PublicRoute>
|
|
|
+ </Route>
|
|
|
</Switch>
|
|
|
{isLoading && <Loader />}
|
|
|
<ToastContainer
|