Skip to content

Commit

Permalink
Merge pull request #56 from AnkitLuhar/main
Browse files Browse the repository at this point in the history
Implementation of the Loader.
  • Loading branch information
kasinadhsarma authored Oct 17, 2024
2 parents 30d7176 + 7157b8a commit 9ccbb16
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 23 deletions.
58 changes: 37 additions & 21 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
import React from 'react';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import './App.css';
import LandingPage from './landing-page';
import AuthPage from './auth-page';
import ForgotPasswordPage from './forgot-password-page';
import Dashboard from './Dashboard'; // Import the Dashboard component
import Chat from './Chat';
import JobBrowser from './JobBrowser';
import Profile from './Profile';
import ScrollToTopButton from './components/ScrollToTopButton';
import React, { useEffect, useState } from "react";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import "./App.css";
import LandingPage from "./landing-page";
import AuthPage from "./auth-page";
import ForgotPasswordPage from "./forgot-password-page";
import Dashboard from "./Dashboard"; // Import the Dashboard component
import Chat from "./Chat";
import JobBrowser from "./JobBrowser";
import Profile from "./Profile";
import ScrollToTopButton from "./components/ScrollToTopButton";
import Loader from "components/Loader";

function App() {
const [isloading, setIsLoading] = useState(true);
useEffect(() => {
const timer = setTimeout(() => {
setIsLoading(false);
}, 2500);

return () => clearTimeout(timer);
}, []);
return (
<Router>
<div className="App">
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/auth" element={<AuthPage />} />
<Route path="/forgot-password" element={<ForgotPasswordPage />} />
<Route path="/dashboard" element={<Dashboard />} /> {/* Add the Dashboard route */}
<Route path="/chat" element={<Chat />} />
<Route path="/job-browser" element={<JobBrowser />} />
<Route path="/profile" element={<Profile />} />
</Routes>
<ScrollToTopButton />
{isloading ? (
<Loader />
) : (
<>
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/auth" element={<AuthPage />} />
<Route path="/forgot-password" element={<ForgotPasswordPage />} />
<Route path="/dashboard" element={<Dashboard />} />{" "}
{/* Add the Dashboard route */}
<Route path="/chat" element={<Chat />} />
<Route path="/job-browser" element={<JobBrowser />} />
<Route path="/profile" element={<Profile />} />
</Routes>
<ScrollToTopButton />
</>
)}
</div>
</Router>
);
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/components/Loader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";
import { HashLoader } from "react-spinners";

const Loader = () => {
return (
<div className="w-full h-screen flex items-center justify-center">
<HashLoader size={100} color="#2453c3" />
</div>
);
};

export default Loader;
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"@chakra-ui/react": "^2.10.1",
"framer-motion": "^11.11.1",
"lucide-react": "^0.447.0",
"react": "^18.3.1"
"react": "^18.3.1",
"react-spinners": "^0.14.1"
},
"devDependencies": {
"@types/react": "^18.3.11"
Expand Down

0 comments on commit 9ccbb16

Please sign in to comment.