From c9b5103731be252bd1dd382dd4b4cf40ec488cb5 Mon Sep 17 00:00:00 2001 From: AKharytonchyk Date: Tue, 5 Nov 2024 14:42:12 +0100 Subject: [PATCH] feat: remove lazy loading --- src/components/Dashboard.tsx | 10 +++------- src/index.tsx | 26 +++++++------------------- src/pages/Coverage.lazy.tsx | 5 ----- src/pages/Dashboard.lazy.tsx | 5 ----- src/pages/LandingPage.lazy.tsx | 5 ----- src/pages/PrLoadingPage.lazy.tsx | 5 ----- 6 files changed, 10 insertions(+), 46 deletions(-) delete mode 100644 src/pages/Coverage.lazy.tsx delete mode 100644 src/pages/Dashboard.lazy.tsx delete mode 100644 src/pages/LandingPage.lazy.tsx delete mode 100644 src/pages/PrLoadingPage.lazy.tsx diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index 40e6a53..f5e3234 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -1,4 +1,4 @@ -import React, { Suspense, useEffect } from "react"; +import React, { useEffect } from "react"; import { ConfigContext } from "../App"; import { PullRequest } from "../models/PullRequest"; import PullRequestCard from "./PullRequestCard"; @@ -9,7 +9,7 @@ import { MultiselectFilter } from "./MultiselectFilter"; import { InputFilter } from "./InputFilter"; import { useQueries } from "@tanstack/react-query"; import { Navigate } from "react-router-dom"; -import PRLoadingPageLazy from "../pages/PrLoadingPage.lazy"; +import PRLoadingPage from "../pages/PRLoadingPage"; export const Dashboard: React.FC = () => { const { octokit, repositorySettings } = React.useContext(ConfigContext); @@ -93,11 +93,7 @@ export const Dashboard: React.FC = () => { return ( - {pending && data.length === 0 && ( - Loading...}> - - - )} + {pending && data.length === 0 && } {!pending && data.length === 0 && } {data.length > 0 && ( <> diff --git a/src/index.tsx b/src/index.tsx index 8a1d0fe..60e1255 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,4 +1,4 @@ -import React, { Suspense } from "react"; +import React from "react"; import ReactDOM from "react-dom/client"; import "./index.css"; import App from "./App"; @@ -6,9 +6,9 @@ import reportWebVitals from "./reportWebVitals"; import { RouterProvider, createHashRouter } from "react-router-dom"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { ScopedCssBaseline } from "@mui/material"; -import LandingPage from "./pages/LandingPage.lazy"; -import Dashboard from "./pages/Dashboard.lazy"; -import Coverage from "./pages/Coverage.lazy"; +import Coverage from "./pages/Coverage"; +import LandingPage from "./pages/LandingPage"; +import Dashboard from "./components/Dashboard"; const router = createHashRouter([ { @@ -17,27 +17,15 @@ const router = createHashRouter([ children: [ { path: "/", - element: ( - Loading...}> - - - ), + element: , }, { path: "/login", - element: ( - Loading...}> - - - ), + element: , }, { path: "/coverage", - element: ( - Loading...}> - - - ), + element: , }, ], }, diff --git a/src/pages/Coverage.lazy.tsx b/src/pages/Coverage.lazy.tsx deleted file mode 100644 index b28993d..0000000 --- a/src/pages/Coverage.lazy.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { lazy } from "react"; - -const Coverage = lazy(() => import("./Coverage")); - -export default Coverage; diff --git a/src/pages/Dashboard.lazy.tsx b/src/pages/Dashboard.lazy.tsx deleted file mode 100644 index d4310ed..0000000 --- a/src/pages/Dashboard.lazy.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; - -const DashboardLazy = React.lazy(() => import('../components/Dashboard')); - -export default DashboardLazy; diff --git a/src/pages/LandingPage.lazy.tsx b/src/pages/LandingPage.lazy.tsx deleted file mode 100644 index 6e621b4..0000000 --- a/src/pages/LandingPage.lazy.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; - -const LandingPageLazy = React.lazy(() => import("./LandingPage")); - -export default LandingPageLazy; diff --git a/src/pages/PrLoadingPage.lazy.tsx b/src/pages/PrLoadingPage.lazy.tsx deleted file mode 100644 index 232d350..0000000 --- a/src/pages/PrLoadingPage.lazy.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; - -const PRLoadingPageLazy = React.lazy(() => import('./PRLoadingPage')); - -export default PRLoadingPageLazy;