forked from Akshatchaube01/TimeWarp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Akshatchaube01#368 from Tanishashrivas/main
Website load enhancement
- Loading branch information
Showing
2 changed files
with
46 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
import React from "react"; | ||
import React, { Suspense, lazy } from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; | ||
import Home from "./components/Home"; | ||
import AboutUs from "./components/AboutUs"; | ||
import DemoSection from "./components/DemoSection"; | ||
import ContactUs from "./components/ContactUs"; | ||
import Navbar from "./components/Navbar"; | ||
import Models from "./components/Models"; | ||
import Custom404 from "./components/Custom404"; | ||
import "./main.css"; | ||
import Privacy from "./components/Privacy"; | ||
import Licensing from "./components/licensing.jsx"; | ||
import Terms from "./components/Terms"; | ||
import ChatbotComponent from "./components/Chatbot"; // Import Chatbot | ||
import Preloader from "./components/Preloader"; | ||
import App from './App.jsx'; | ||
import ChatbotComponent from "./components/Chatbot"; // Import Chatbot | ||
|
||
// Lazy load components | ||
const Home = lazy(() => import("./components/Home")); | ||
const AboutUs = lazy(() => import("./components/AboutUs")); | ||
const DemoSection = lazy(() => import("./components/DemoSection")); | ||
const ContactUs = lazy(() => import("./components/ContactUs")); | ||
const Models = lazy(() => import("./components/Models")); | ||
const Privacy = lazy(() => import("./components/Privacy")); | ||
const Licensing = lazy(() => import("./components/licensing.jsx")); | ||
const Terms = lazy(() => import("./components/Terms")); | ||
|
||
ReactDOM.createRoot(document.getElementById("root")).render( | ||
<Router> | ||
|
||
<Preloader /> | ||
<Navbar />{" "} | ||
{/* Place Navbar outside of Routes to ensure it's always visible */} | ||
<Routes> | ||
<Route exact path='/' element={<Home />} /> | ||
<Route exact path='/AboutUs' element={<AboutUs />} /> | ||
<Route exact path='/DemoSection' element={<DemoSection />} /> | ||
<Route exact path='/ContactUs' element={<ContactUs />} /> | ||
<Route exact path='/Models' element={<Models />} /> | ||
<Route exact path='/privacy-policy' element={<Privacy />} /> | ||
<Route exact path='/licensing' element={<Licensing />} /> | ||
<Route exact path='/terms-and-conditions' element={<Terms />} /> | ||
<Route path='*' element={<Custom404 />} /> | ||
</Routes> | ||
<Navbar /> {/* Place Navbar outside of Routes to ensure it's always visible */} | ||
<Suspense fallback={<div>Loading...</div>}> | ||
<Routes> | ||
<Route exact path="/" element={<Home />} /> | ||
<Route exact path="/AboutUs" element={<AboutUs />} /> | ||
<Route exact path="/DemoSection" element={<DemoSection />} /> | ||
<Route exact path="/ContactUs" element={<ContactUs />} /> | ||
<Route exact path="/Models" element={<Models />} /> | ||
<Route exact path="/privacy-policy" element={<Privacy />} /> | ||
<Route exact path="/licensing" element={<Licensing />} /> | ||
<Route exact path="/terms-and-conditions" element={<Terms />} /> | ||
<Route path="*" element={<Custom404 />} /> | ||
</Routes> | ||
</Suspense> | ||
<ChatbotComponent /> {/* Include Chatbot */} | ||
</Router> | ||
); |