Skip to content

Commit

Permalink
remove lazy loading of home, login and register components
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsingh132 committed Aug 24, 2023
1 parent 5851dcf commit 5677017
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { removeAllProducts } from "./redux/cartRedux";
import "./components/Styles/app.css";
import LoadingOverlay from "./components/SpinnerOverlay";
import { loginFailure } from "./redux/userRedux";
import Login from "./pages/Login";
import Register from "./pages/Register";
import Home from "./pages/Home";

const Home = lazy(() => import("./pages/Home"));
const Product = lazy(() => import("./pages/Product"));
const ProductList = lazy(() => import("./pages/ProductList"));
const Register = lazy(() => import("./pages/Register"));
const Login = lazy(() => import("./pages/Login"));
const Cart = lazy(() => import("./pages/Cart"));
const Success = lazy(() => import("./pages/Success"));
const OrderDetails = lazy(() => import("./pages/OrderDetails"));
Expand Down Expand Up @@ -99,12 +99,10 @@ const App = () => {
</Suspense>
}
/>
<Route
path="/login"
element={
<Suspense fallback={<LoadingOverlay />}>
{user ? <Navigate to="/" /> : <Login />}
</Suspense>
<Route
path="/login"
element={
user ? <Navigate to = "/" /> : <Login />
}
/>
<Route
Expand All @@ -118,9 +116,7 @@ const App = () => {
<Route
path="/register"
element={
<Suspense fallback={<LoadingOverlay />}>
{user ? <Navigate to="/" /> : <Register />}
</Suspense>
user ? <Navigate to = "/" /> : <Register />
}
/>
<Route
Expand Down

0 comments on commit 5677017

Please sign in to comment.