-
Notifications
You must be signed in to change notification settings - Fork 34
Fix #12: added a home/ user onboarding page #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
611318e
245e8c6
4f89edd
a643568
3245925
3e7b5ee
13b9f95
91a853b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,63 @@ | ||
|
|
||
| import { Routes, Route, useLocation, matchRoutes } from 'react-router-dom'; | ||
| import { Routes, Route, useLocation, matchRoutes } from "react-router-dom"; | ||
| import { Suspense, lazy } from "react"; | ||
| import Loading from './utils/Global-Loading/Loading'; | ||
| import useRouteProgress from './hooks/useRouteProgress.js'; | ||
| import './styles/nprogress-custom.css'; | ||
| const LandingPage = lazy(() => import('./pages/landingPage/LandingPage')); | ||
| const Home = lazy(() => import('./pages/Home')); | ||
| const Branch = lazy(() => import('./pages/Branch')); | ||
| const Semester = lazy(() => import('./pages/Semester')); | ||
| const Subject = lazy(() => import('./pages/Subject')); | ||
| const AdminDashboard = lazy(() => import('./pages/AdminDashboard')); | ||
| const NotFound = lazy(() => import('./pages/404/NotFound')); | ||
| const LoginPage = lazy(() => import('./pages/Login/Login')); | ||
| const SignUp = lazy(() => import('./pages/SignUp/SignUp')); | ||
| import Loading from "./utils/Global-Loading/Loading"; | ||
| import useRouteProgress from "./hooks/useRouteProgress.js"; | ||
| import "./styles/nprogress-custom.css"; | ||
| const LandingPage = lazy(() => import("./pages/landingPage/LandingPage")); | ||
| const Home = lazy(() => import("./pages/Home/Home.jsx")); | ||
| const Branch = lazy(() => import("./pages/Branch")); | ||
| const Semester = lazy(() => import("./pages/Semester")); | ||
| const Subject = lazy(() => import("./pages/Subject")); | ||
| const AdminDashboard = lazy(() => import("./pages/AdminDashboard")); | ||
| const NotFound = lazy(() => import("./pages/404/NotFound")); | ||
| const LoginPage = lazy(() => import("./pages/Login/Login")); | ||
| const SignUp = lazy(() => import("./pages/SignUp/SignUp")); | ||
|
|
||
| import Header from './components/Header/Header'; | ||
| import Footer from './components/Footer/Footer'; | ||
| import Header from "./components/Header/Header"; | ||
| import Footer from "./components/Footer/Footer"; | ||
| const routes = [ | ||
| { path: '/' }, | ||
| { path: '/home' }, | ||
| { path: '/branch/:branchId' }, | ||
| { path: '/branch/:branchId/semester/:semesterId' }, | ||
| { path: '/branch/:branchId/semester/:semesterId/subject/:subjectId' }, | ||
| { path: '/admin' }, | ||
| { path: '/login' }, | ||
| { path: '/signup' } | ||
| { path: "/" }, | ||
| { path: "/home" }, | ||
| { path: "/branch/:branchId" }, | ||
| { path: "/branch/:branchId/semester/:semesterId" }, | ||
| { path: "/branch/:branchId/semester/:semesterId/subject/:subjectId" }, | ||
| { path: "/admin" }, | ||
|
Comment on lines
-20
to
+24
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did u change the quotes lol ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My formatter fr sorry... |
||
| { path: "/login" }, | ||
| { path: "/signup" }, | ||
|
Comment on lines
-20
to
+26
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol 🙂 |
||
| ]; | ||
|
|
||
| export default function App() { | ||
|
|
||
| const location = useLocation(); | ||
| const matched = matchRoutes(routes, location.pathname); | ||
| const is404 = !matched; | ||
|
|
||
| useRouteProgress(); | ||
| const location = useLocation(); | ||
| const matched = matchRoutes(routes, location.pathname); | ||
| const is404 = !matched; | ||
|
|
||
| useRouteProgress(); | ||
|
Comment on lines
-31
to
+34
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. un-necessary whitespace changes makes your PR very clouded and hard to review. Pls take care from next time. |
||
|
|
||
| return ( | ||
| <> | ||
| {!is404 && <Header />} | ||
| <main className="main-content"> | ||
| <Suspense fallback={<Loading />}> | ||
| <Routes> | ||
| <Route path="/home" element={<Home />} /> | ||
| <Route path="/" element={<LandingPage />} /> | ||
| <Route path="/branch/:branchId" element={<Branch />} /> | ||
| <Route path="/branch/:branchId/semester/:semesterId" element={<Semester />} /> | ||
| <Route path="/branch/:branchId/semester/:semesterId/subject/:subjectId" element={<Subject />} /> | ||
| <Route path="/admin" element={<AdminDashboard />} /> | ||
| <Route path="/login" element={<LoginPage />} /> | ||
| <Route path="/signup" element={<SignUp />} /> | ||
| <Route path="*" element={<NotFound />}/> | ||
| </Routes> | ||
| </Suspense> | ||
| </main> | ||
| {!is404 && <Footer />} | ||
| </> | ||
| ); | ||
| return ( | ||
| <> | ||
| {!is404 && <Header />} | ||
| <main className="main-content"> | ||
| <Suspense fallback={<Loading />}> | ||
| <Routes> | ||
| <Route path="/home" element={<Home />} /> | ||
| <Route path="/" element={<LandingPage />} /> | ||
| <Route path="/branch/:branchId" element={<Branch />} /> | ||
| <Route | ||
| path="/branch/:branchId/semester/:semesterId" | ||
| element={<Semester />} | ||
| /> | ||
|
Comment on lines
-38
to
+48
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes are literally un-necessary, as Git shows whitespace changes as well, I now have to go through all these un-necessary whitespace updates to find and review the proper update. Pls take care next time
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry😭 |
||
| <Route | ||
| path="/branch/:branchId/semester/:semesterId/subject/:subjectId" | ||
| element={<Subject />} | ||
| /> | ||
| <Route path="/admin" element={<AdminDashboard />} /> | ||
| <Route path="/login" element={<LoginPage />} /> | ||
| <Route path="/signup" element={<SignUp />} /> | ||
| <Route path="*" element={<NotFound />} /> | ||
| </Routes> | ||
| </Suspense> | ||
| </main> | ||
| {!is404 && <Footer />} | ||
| </> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😑