diff --git a/src/components/CapstoneAdviser/AdviserDashboard.jsx b/src/components/CapstoneAdviser/AdviserDashboard.jsx index cbc23f7..8638223 100644 --- a/src/components/CapstoneAdviser/AdviserDashboard.jsx +++ b/src/components/CapstoneAdviser/AdviserDashboard.jsx @@ -3,6 +3,7 @@ import { useNavigate, useLocation, useParams } from "react-router-dom"; import Sidebar from "../Sidebar"; import { useAuthGuard } from "../../components/hooks/useAuthGuard"; import AdviserTeamSummary from "./AdviserTeamsSummary"; +import AdviserTermsOfService from "./AdviserTermsOfService"; import AdviserTask from "./AdviserTask/AdviserTask"; import AdviserOralDef from "./AdviserTask/AdviserOralDef"; import AdviserFinalDef from "./AdviserTask/AdviserFinalDef"; @@ -361,6 +362,8 @@ const AdviserDashboard = ({ activePageFromHeader }) => { switch (activePage) { case "TeamsSummary": return ; + case "TermsOfService": + return ; case "Tasks": return ; case "Oral Defense": diff --git a/src/components/CapstoneAdviser/AdviserTermsOfService.jsx b/src/components/CapstoneAdviser/AdviserTermsOfService.jsx new file mode 100644 index 0000000..c948888 --- /dev/null +++ b/src/components/CapstoneAdviser/AdviserTermsOfService.jsx @@ -0,0 +1,149 @@ +// src/pages/Adviser/TermsOfService.jsx +import React, { useState, useEffect } from "react"; +import { useNavigate } from "react-router-dom"; +import Swal from "sweetalert2"; +import { supabase } from "../../supabaseClient"; +import Header from "../Header"; +import Footer from "../Footer"; + +const AdviserTermsOfService = () => { + const [choice, setChoice] = useState(""); + const navigate = useNavigate(); + + // check if logged in + useEffect(() => { + const storedUser = localStorage.getItem("customUser"); + if (!storedUser) { + navigate("/Signin"); + } + }, [navigate]); + + const handleSave = async () => { + const storedUser = localStorage.getItem("customUser"); + if (!storedUser) { + navigate("/Signin"); + return; + } + + const user = JSON.parse(storedUser); + + if (choice === "accept") { + Swal.fire({ + icon: "success", + title: "Terms Accepted", + text: "Thank you for accepting the terms of service.", + timer: 1500, + showConfirmButton: false, + }); + + // OPTIONAL: Update Supabase record (if you track agreement) + await supabase + .from("user_credentials") + .update({ terms_accepted: true }) + .eq("id", user.id); + + navigate("/Adviser/Dashboard"); + } + else if (choice === "decline") { + Swal.fire({ + icon: "warning", + title: "Terms Declined", + text: "You must accept the Terms of Service to continue.", + timer: 1500, + showConfirmButton: false, + }); + + // log out + localStorage.removeItem("customUser"); + localStorage.removeItem("user_id"); + navigate("/Signin", { replace: true }); + } + else { + Swal.fire({ + icon: "info", + title: "No Selection", + text: "Please select Accept or Decline before saving.", + }); + } + }; + + return ( +
+
+ +
+
+

+ Terms of Service +

+ +
+ {/* ✳️ Your terms content here */} +

+ Welcome to the TaskSphere IT platform. By using this system, you + agree to comply with the institutional guidelines for managing, + evaluating, and monitoring IT Capstone projects. +

+

+ Advisers are expected to uphold academic integrity, maintain + confidentiality of student works, and ensure fair evaluation + across all teams. +

+

+ Any misuse of this system, unauthorized sharing of data, or + violation of confidentiality policies may result in account + suspension or disciplinary action. +

+

+ Continued use of the platform signifies your acceptance of these + terms and all future updates communicated through official + channels. +

+

+ Please read carefully and select whether you accept or decline the + Terms of Service below. +

+
+ +
+ + +
+ +
+ +
+
+
+ +
+
+ ); +}; + +export default AdviserTermsOfService; diff --git a/src/components/Signin.jsx b/src/components/Signin.jsx index 8a150fd..11d873b 100644 --- a/src/components/Signin.jsx +++ b/src/components/Signin.jsx @@ -18,15 +18,11 @@ const Signin = () => { const { setIsLoggedIn } = useOutletContext(); const { login } = UserAuth(); - // Hard lock page scroll (belt-and-suspenders) + // Lock scroll on mount useEffect(() => { - const prevDoc = document.documentElement.style.overflow; - const prevBody = document.body.style.overflow; - document.documentElement.style.overflow = "hidden"; - document.body.style.overflow = "hidden"; + document.body.style.overflow = 'hidden'; return () => { - document.documentElement.style.overflow = prevDoc; - document.body.style.overflow = prevBody; + document.body.style.overflow = 'unset'; }; }, []); @@ -114,32 +110,37 @@ const Signin = () => { }, [navigate]); return ( - // Lock the page height; no scroll -
- - - {/* Main fills remaining height; internal overflow hidden */} -
-
-
- {/* Left: taller login card */} -
-
-

+
+ {/* Fixed Header */} +
+ +
+ + {/* Main Content - Completely locked, content scales to fit */} +
+
+
+ + {/* Left: Login Card */} +
+
+

Welcome to -
- TaskSphere IT +

+

+ TaskSphere IT

TaskSphere icon -
+
-
-
- {/* Right: seal + headline */} -
- CCS Seal -

- A Task Management System for -
- Capstone Project Development + {/* Right: Seal and Description */} +

+ CCS Seal +

+ A Task Management System for
Capstone Project Development

- + {/* Fixed Footer */} +
+ +
); }; -export default Signin; +export default Signin; \ No newline at end of file diff --git a/src/components/heade-foot/SigninFoot.jsx b/src/components/heade-foot/SigninFoot.jsx index 6470ae3..26a9acb 100644 --- a/src/components/heade-foot/SigninFoot.jsx +++ b/src/components/heade-foot/SigninFoot.jsx @@ -2,16 +2,15 @@ import React from "react"; const SigninFoot = () => { return ( - // Fixed footer so it doesn't add to page height -