Skip to content

Commit 92adf4a

Browse files
authored
Merge pull request #45 from LightCreator1007/feat/user-onboarding
Fix #12: added a home/ user onboarding page
2 parents ffc8dc3 + 91a853b commit 92adf4a

File tree

12 files changed

+2277
-1722
lines changed

12 files changed

+2277
-1722
lines changed

backend/.env.sample

Lines changed: 0 additions & 9 deletions
This file was deleted.
File renamed without changes.

frontend/src/App.jsx

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,63 @@
1-
2-
import { Routes, Route, useLocation, matchRoutes } from 'react-router-dom';
1+
import { Routes, Route, useLocation, matchRoutes } from "react-router-dom";
32
import { Suspense, lazy } from "react";
4-
import Loading from './utils/Global-Loading/Loading';
5-
import useRouteProgress from './hooks/useRouteProgress.js';
6-
import './styles/nprogress-custom.css';
7-
const LandingPage = lazy(() => import('./pages/landingPage/LandingPage'));
8-
const Home = lazy(() => import('./pages/Home'));
9-
const Branch = lazy(() => import('./pages/Branch'));
10-
const Semester = lazy(() => import('./pages/Semester'));
11-
const Subject = lazy(() => import('./pages/Subject'));
12-
const AdminDashboard = lazy(() => import('./pages/AdminDashboard'));
13-
const NotFound = lazy(() => import('./pages/404/NotFound'));
14-
const LoginPage = lazy(() => import('./pages/Login/Login'));
15-
const SignUp = lazy(() => import('./pages/SignUp/SignUp'));
3+
import Loading from "./utils/Global-Loading/Loading";
4+
import useRouteProgress from "./hooks/useRouteProgress.js";
5+
import "./styles/nprogress-custom.css";
6+
const LandingPage = lazy(() => import("./pages/landingPage/LandingPage"));
7+
const Home = lazy(() => import("./pages/Home/Home.jsx"));
8+
const Branch = lazy(() => import("./pages/Branch"));
9+
const Semester = lazy(() => import("./pages/Semester"));
10+
const Subject = lazy(() => import("./pages/Subject"));
11+
const AdminDashboard = lazy(() => import("./pages/AdminDashboard"));
12+
const NotFound = lazy(() => import("./pages/404/NotFound"));
13+
const LoginPage = lazy(() => import("./pages/Login/Login"));
14+
const SignUp = lazy(() => import("./pages/SignUp/SignUp"));
1615

17-
import Header from './components/Header/Header';
18-
import Footer from './components/Footer/Footer';
16+
import Header from "./components/Header/Header";
17+
import Footer from "./components/Footer/Footer";
1918
const routes = [
20-
{ path: '/' },
21-
{ path: '/home' },
22-
{ path: '/branch/:branchId' },
23-
{ path: '/branch/:branchId/semester/:semesterId' },
24-
{ path: '/branch/:branchId/semester/:semesterId/subject/:subjectId' },
25-
{ path: '/admin' },
26-
{ path: '/login' },
27-
{ path: '/signup' }
19+
{ path: "/" },
20+
{ path: "/home" },
21+
{ path: "/branch/:branchId" },
22+
{ path: "/branch/:branchId/semester/:semesterId" },
23+
{ path: "/branch/:branchId/semester/:semesterId/subject/:subjectId" },
24+
{ path: "/admin" },
25+
{ path: "/login" },
26+
{ path: "/signup" },
2827
];
2928

3029
export default function App() {
31-
32-
const location = useLocation();
33-
const matched = matchRoutes(routes, location.pathname);
34-
const is404 = !matched;
35-
36-
useRouteProgress();
30+
const location = useLocation();
31+
const matched = matchRoutes(routes, location.pathname);
32+
const is404 = !matched;
33+
34+
useRouteProgress();
3735

38-
return (
39-
<>
40-
{!is404 && <Header />}
41-
<main className="main-content">
42-
<Suspense fallback={<Loading />}>
43-
<Routes>
44-
<Route path="/home" element={<Home />} />
45-
<Route path="/" element={<LandingPage />} />
46-
<Route path="/branch/:branchId" element={<Branch />} />
47-
<Route path="/branch/:branchId/semester/:semesterId" element={<Semester />} />
48-
<Route path="/branch/:branchId/semester/:semesterId/subject/:subjectId" element={<Subject />} />
49-
<Route path="/admin" element={<AdminDashboard />} />
50-
<Route path="/login" element={<LoginPage />} />
51-
<Route path="/signup" element={<SignUp />} />
52-
<Route path="*" element={<NotFound />}/>
53-
</Routes>
54-
</Suspense>
55-
</main>
56-
{!is404 && <Footer />}
57-
</>
58-
);
36+
return (
37+
<>
38+
{!is404 && <Header />}
39+
<main className="main-content">
40+
<Suspense fallback={<Loading />}>
41+
<Routes>
42+
<Route path="/home" element={<Home />} />
43+
<Route path="/" element={<LandingPage />} />
44+
<Route path="/branch/:branchId" element={<Branch />} />
45+
<Route
46+
path="/branch/:branchId/semester/:semesterId"
47+
element={<Semester />}
48+
/>
49+
<Route
50+
path="/branch/:branchId/semester/:semesterId/subject/:subjectId"
51+
element={<Subject />}
52+
/>
53+
<Route path="/admin" element={<AdminDashboard />} />
54+
<Route path="/login" element={<LoginPage />} />
55+
<Route path="/signup" element={<SignUp />} />
56+
<Route path="*" element={<NotFound />} />
57+
</Routes>
58+
</Suspense>
59+
</main>
60+
{!is404 && <Footer />}
61+
</>
62+
);
5963
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 17 additions & 0 deletions
Loading
61.6 KB
Loading

0 commit comments

Comments
 (0)