Skip to content
Snippets Groups Projects
Commit baeeada6 authored by Asal Sahami Moghaddam's avatar Asal Sahami Moghaddam
Browse files

Committing changes before pulling

parent 6bcd4be6
No related branches found
No related tags found
No related merge requests found
import { useState, useEffect } from "react";
import React, { useEffect } from "react";
import "./App.css";
import "../contents/example.css"
import "../contents/example.css";
import "./App.scss";
import 'beautiful-react-diagrams/styles.css';
import "bootstrap/dist/css/bootstrap.min.css";
import { Route, Routes } from "react-router-dom";
import { Routes, Route } from "react-router-dom";
import { Footer } from "../components/Footer.tsx";
import { NotFound } from "../components/NotFound.tsx";
import { Navbar } from "../components/Navbar.tsx";
......@@ -12,12 +12,10 @@ import { getPathMapping } from "../utils/getPathMapping.ts";
import { stringToSlug } from "../utils/stringToSlug.ts";
import { Villbuttonrow } from "../components/Buttons.tsx";
import "../utils/highlight.js";
import LoadingScreen from "../components/LoadingScreen.tsx";
import "./LoadingScreen.css";
import { Description } from "../contents/description.tsx";
const App = () => {
const [isLoading, setIsLoading] = useState(true);
const pathMapping = getPathMapping();
const currentPath =
location.pathname
......@@ -32,69 +30,72 @@ const App = () => {
document.title = `${title || ""} | ${import.meta.env.VITE_TEAM_NAME} - iGEM ${import.meta.env.VITE_TEAM_YEAR}`;
}, [title]);
useEffect(() => {
const timer = setTimeout(() => {
console.log("Hiding loading screen");
setIsLoading(false);
}, 0); // Adjust the delay as needed, Update the loading state after 3 seconds
return () => {
console.log("Cleaning up timer");
clearTimeout(timer); // Clear the timer on component unmount
};
}, []);
return (
<>
{isLoading ? (
<LoadingScreen />
) : (
<>
{/* Navigation */}
<Navbar/>
{/* Navigation */}
<Navbar />
{/* Header and PageContent */}
<Routes>
{Object.entries(pathMapping).map(([path, {header: Header, component: Component, navlist: Sidebar}]) => (
<Route
key={path}
path={path}
element={
<>
<Header/>
{/* Page content */}
<div className="container-fluid">
<div className="row">
<Sidebar/>
<div className="col">
<Component />
<Villbuttonrow/>
</div>
<div className="col-1 d-none d-lg-block">
{/* <!-- empty!--> */}
</div>
</div>
{/* Header and PageContent */}
<Routes>
{Object.entries(pathMapping).map(([path, { header: Header, component: Component, navlist: Sidebar }]) => (
<Route
key={path}
path={path}
element={
<>
<Header />
{/* Page content */}
<div className="container-fluid">
<div className="row">
<Sidebar />
<div className="col">
<Component />
<Villbuttonrow />
</div>
{/* End page content */}
</>
}
/>
))}
<Route
path="*"
element={
<>
<NotFound />
</>
}
/>
</Routes>
<div className="col-1 d-none d-lg-block">
{/* <!-- empty!--> */}
</div>
</div>
</div>
{/* End page content */}
</>
}
/>
))}
{/* Add a route for the Description component */}
<Route
path="/description"
element={
<>
{/* Page content */}
<div className="container-fluid">
<div className="row">
<div className="col">
<Description />
<Villbuttonrow />
</div>
<div className="col-1 d-none d-lg-block">
{/* <!-- empty!--> */}
</div>
</div>
</div>
</>
}
/>
<Route
path="*"
element={
<>
<NotFound />
</>
}
/>
</Routes>
{/* Footer */}
<Footer />
</>
)}
{/* Footer */}
<Footer />
</>
);
};
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment