diff --git a/admin/src/App.jsx b/admin/src/App.jsx
index 3c0730f..c1f51be 100644
--- a/admin/src/App.jsx
+++ b/admin/src/App.jsx
@@ -1,68 +1,27 @@
-import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
-import "./index.css";
+import { BrowserRouter, Routes, Route } from "react-router-dom";
+import DashboardLayout from "./components/DashboardLayout";
import Dashboard from "./components/Dashboard";
import Login from "./components/Login";
import Register from "./components/Register";
-import Header from "./components/Header";
import AddScheme from "./components/AddScheme";
-import Schemes from "./components/Schemes";
-import DashboardLayout from "./components/DashboardLayout";
-import { useContext, useEffect, useState } from "react";
-import Employees from "./components/Employees";
-import Announcement from "./components/Announcement";
-import Grievances from "./components/Grievances";
-import Tickets from "./components/Tickets";
-import SingleTicket from "./components/SingleTicket";
-import { AdminContext } from "./components/context/adminContext";
-import Notifications from "./components/Notifications";
-import SingleEmployee from "./components/SingleEmployee";
-import Profile from "./components/Profile";
-import SingleGrievance from "./components/SingleGrievance";
-import Message from "./components/Message";
-import SingleScheme from "./components/SingleScheme";
-const ProtectedRoutes = ({ children }) => {
- const { isAuthenticated ,token} = useContext(AdminContext);
-
- if (isAuthenticated && token) {
- return children;
- }
- return ;
-};
+// ✅ Import ScrollToBottom
+import ScrollToBottom from "./components/ScrollToBottom";
function App() {
- const {isAuthenticated , token} = useContext(AdminContext)
-
-
return (
-
- : } />
- :} />
-
-
-
-
- }>
+ }>
} />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- } />
- }/>
- }/>
- }/>
- }/>
+ } />
+ } />
+ } />
+
+ {/* ✅ Always render scroll button */}
+
);
}
diff --git a/user/src/App.jsx b/user/src/App.jsx
index 12e835f..6b0eaac 100644
--- a/user/src/App.jsx
+++ b/user/src/App.jsx
@@ -1,9 +1,9 @@
- import { BrowserRouter, Route, Routes } from 'react-router-dom';
- import ScrollToTop from './components/ScrollToTop';
+import { BrowserRouter, Route, Routes } from 'react-router-dom';
+import ScrollToTop from './components/ScrollToTop';
+import ScrollToBottom from './components/ScrollToBottom'; // ✅ added
import './App.css'
-
import Navbar from './components/Navbar';
import Home from './components/pages/home/Home';
import Header from './components/Header';
@@ -29,51 +29,49 @@ import GrievancesApplied from './components/GrievancesApplied';
import Status from './components/Status';
import Dashboard from './components/Dashboard';
import Contact from './components/Contact';
-import Faq from './components/Faq';
-import PrivacyPolicy from './components/PrivacyPolicy';
-import LinkingPolicy from './components/LinkingPolicy';
function App() {
const [isAuthenticated, setIsAuthenticated] = useState(false);
- // const
+
useEffect(() => {
const token = localStorage.getItem('token');
setIsAuthenticated(!!token);
}, []);
+
return (
-
-
-
-
- }/>
- : }/>
- : }/>
- : }/>
- }/>
- }/>
- }/>
- }/>
- }/>
- }/>
- :}/>
- : }/>
- : }/>
- : }/>
- : }/>
- : }/>
- : }/>
- }/>
- }/>
- }/>
- }/>
- }/>
- }/>
-
-
-
+
+
+
+
+
+ }/>
+ : }/>
+ : }/>
+ : }/>
+ }/>
+ }/>
+ }/>
+ }/>
+ }/>
+ }/>
+ :}/>
+ : }/>
+ : }/>
+ : }/>
+ : }/>
+ : }/>
+ : }/>
+ }/>
+ }/>
+ }/>
+
+
+
+
+ {/* ✅ added below ScrollToTop */}
)
}
-export default App
+export default App;
diff --git a/user/src/components/ScrollToBottom.css b/user/src/components/ScrollToBottom.css
new file mode 100644
index 0000000..11c961e
--- /dev/null
+++ b/user/src/components/ScrollToBottom.css
@@ -0,0 +1,35 @@
+.scroll-to-bottom {
+ position: fixed;
+ bottom: 90px; /* placed above scroll-to-top */
+ right: 30px;
+ z-index: 100;
+ background-color: rgba(153, 27, 27, 0.9); /* 🔴 match scroll-to-top */
+ color: white;
+ border: none;
+ border-radius: 50%;
+ padding: 20px 20px;
+ font-size: 20px;
+ cursor: pointer;
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
+ transition: background-color 0.3s;
+}
+
+.scroll-to-bottom:hover {
+ background-color: rgb(154 52 18 / 0.7); /* 🔴 same hover as scroll-to-top */
+}
+
+.scroll-to-bottom.visible {
+ opacity: 1;
+ transform: translateY(0);
+}
+
+@media (max-width: 480px) {
+ .scroll-to-bottom {
+ width: 40px;
+ height: 40px;
+ padding: 12px;
+ font-size: 18px;
+ bottom: 65px; /* adjusts for mobile */
+ right: 15px;
+ }
+}
diff --git a/user/src/components/ScrollToBottom.jsx b/user/src/components/ScrollToBottom.jsx
new file mode 100644
index 0000000..2eff976
--- /dev/null
+++ b/user/src/components/ScrollToBottom.jsx
@@ -0,0 +1,38 @@
+import { useEffect, useState } from "react";
+import { FaArrowCircleDown } from "react-icons/fa";
+import "./ScrollToBottom.css";
+
+const ScrollToBottom = () => {
+ const [visible, setVisible] = useState(false);
+
+ // Show button if not at bottom
+ const toggleVisibility = () => {
+ if (window.innerHeight + window.scrollY < document.body.scrollHeight - 100) {
+ setVisible(true);
+ } else {
+ setVisible(false);
+ }
+ };
+
+ const scrollToBottom = () => {
+ window.scrollTo({
+ top: document.body.scrollHeight,
+ behavior: "smooth",
+ });
+ };
+
+ useEffect(() => {
+ window.addEventListener("scroll", toggleVisibility);
+ return () => window.removeEventListener("scroll", toggleVisibility);
+ }, []);
+
+ return (
+ visible && (
+
+ )
+ );
+};
+
+export default ScrollToBottom;