Skip to content

Commit

Permalink
started working on the student-dashboard finally
Browse files Browse the repository at this point in the history
  • Loading branch information
yours7himanshu committed Jan 18, 2025
1 parent 5dccbac commit a7ae9b4
Show file tree
Hide file tree
Showing 13 changed files with 287 additions and 45 deletions.
4 changes: 2 additions & 2 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import StudentDashboard from "./Student Dashboard/Dashboard/StudentDashboard.jsx
function App() {
return (
<>
<Navbar />
{/* <Navbar /> */}

<ToastContainer/>
<PeerProvider>
Expand All @@ -67,7 +67,7 @@ function App() {
<Route path="/login" element={<Login/>} />
<Route path="/ai" element={<AiAssistent/>}/>
<Route path="/MainLogin" element={<MainLoginPage/>}/>
<Route path="/StudentDashboard" element={<StudentDashboard/>}/>
<Route path="/StudentDashboard/dashboard" element={<StudentDashboard/>}/>
<Route path="/displayAnnoncement"element={<Announcement/>}/>

</Routes>
Expand Down
3 changes: 2 additions & 1 deletion client/src/Student Dashboard/Dashboard/StudentDashboard.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import Layout from '../Layout/Layout'

const StudentDashboard = () => {
return (
Expand All @@ -8,4 +9,4 @@ const StudentDashboard = () => {
)
}

export default StudentDashboard
export default Layout()(StudentDashboard);
20 changes: 19 additions & 1 deletion client/src/Student Dashboard/Layout/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,22 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
*/

import React from 'react'
import Sidebar from '../Sidebar/Sidebar'


const Layout = () => (WrapLayoutComponent)=> {
return (props)=>{

return (
<div className='flex' >
<Sidebar/>
<WrapLayoutComponent {...props} />
</div>
)
}
}

export default Layout
202 changes: 202 additions & 0 deletions client/src/Student Dashboard/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@

/*
Copyright 2024 Himanshu Dinkar
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import { useState } from "react";
import { useLocation, useNavigate } from "react-router-dom";
// import { ContextStore } from "../store/ContextStore";



import LiveTvIcon from '@mui/icons-material/LiveTv';
import DashboardIcon from '@mui/icons-material/Dashboard';
import CampaignIcon from '@mui/icons-material/Campaign';
import EventNoteIcon from '@mui/icons-material/EventNote';
import QuizIcon from '@mui/icons-material/Quiz';
import AssignmentIcon from '@mui/icons-material/Assignment';
// import Modal from "../components/Model";
const Sidebar = () => {


const location = useLocation();
// const [isModalOpen, setIsModalOpen] = useState(false);
const navigate = useNavigate();




const isActive = (path) => location.pathname === path;


const handleNavigation = (path) => {
if (location.pathname !== path) {
navigate(path);
}
};

return (
<div className="flex max-md:hidden ">
{/* Sidebar */}
<div className="sidebar fixed top-0 left-0 h-screen flex flex-col w-[20%] bg-gradient-to-tr from-indigo-800 to-blue-700 text-white">
<ul className="flex flex-col ml-10 gap-5">
{/* <Logo /> */}
<div className="flex gap-4" >
<li
onClick={() => handleNavigation("/dashboard")}
className={`list-style-none flex items-center gap-4 font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer hover:text-gray-700 transition-all duration-75 ${
isActive("/dashboard")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
<DashboardIcon/>
Dashboard
</li>
</div>


<li
onClick={() => handleNavigation("/add-teachers")}
className={`list-style-none font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer ${
isActive("/add-teachers")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
Add Teachers
</li>

<li
onClick={() => handleNavigation("/enroll-students")}
className={`list-style-none font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer ${
isActive("/enroll-students")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
Enroll Students
</li>

<li
onClick={() => handleNavigation("/announcement")}
className={`list-style-none flex items-center gap-2 font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer ${
isActive("/announcement")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
<CampaignIcon/>
Announcement
</li>


<li
onClick={() => handleNavigation("/timetable")}
className={`list-style-none flex gap-4 items-center font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer ${
isActive("/timetable")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
<EventNoteIcon/>
Time Table
</li>


<li
onClick={() => handleNavigation("/post-quiz")}
className={`list-style-none flex items-center gap-4 font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer ${
isActive("/post-quiz")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
<QuizIcon/>
Quiz
</li>


<li
onClick={() => handleNavigation("/post-assignment")}
className={`list-style-none flex items-center gap-4 font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer ${
isActive("/post-assignment")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
<AssignmentIcon/>
Assignment
</li>


<li
onClick={() => handleNavigation("/student-detail")}
className={`list-style-none font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer ${
isActive("/admin-live")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
Student Details
</li>

<li
onClick={() => handleNavigation("/teachers")}
className={`list-style-none font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer ${
isActive("/admin-live")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
Teacher Details
</li>

<div className="flex items-center gap-4" >
<li
onClick={() => setIsModalOpen(true)}
className={`list-style-none flex items-center gap-4 font-medium focus:bg-blue-400 p-3 w-[80%] cursor-pointer ${
isActive("/admin-live")
? "bg-white text-black border rounded-md"
: "text-white"
}`}
>
<LiveTvIcon />
Go Live Class
</li>
</div>

</ul>
</div>

{/* <Modal
isOpen={isModalOpen}
onClose={() => setIsModalOpen(false)}
onSubmit={() => console.log("Handle Room Join")}
email=""
setEmail={() => {}}
roomId=""
setRoomId={() => {}}
loading={false}
/> */}

{/* Loader */}

</div>
);
};

export default Sidebar;
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,22 @@ limitations under the License.




import React from 'react'
import Navbar from '../components/Navbar/Navbar'
import Footer from '../shared/Footer/Footer'

const ServiceLayout = () => (WrapLayoutComponent)=> {
return (props)=>{

return (
<div className='flex flex-col' >
<Navbar/>
<WrapLayoutComponent {...props} />
<Footer/>
</div>
)
}
}

const Layout = () => {
return (
<div>

</div>
)
}
export default ServiceLayout

export default Layout
5 changes: 3 additions & 2 deletions client/src/pages/About/AboutPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import ServiceSection from "./components/ServiceSection";
import MissionSection from "./components/MissionSection";
import JourneySection from "./components/JourneySection";
import TeamSection from "./components/TeamSection";
import ServiceLayout from "../../layout/ServiceLayout";

const AboutPage = () => {
return (
Expand Down Expand Up @@ -52,9 +53,9 @@ const AboutPage = () => {
<hr className="outline-none border-t-2 border-indigo-900 max-md:mx-11 mx-24" />

{/* Footer */}
<Footer />
{/* <Footer /> */}
</div>
);
};

export default AboutPage;
export default ServiceLayout()(AboutPage);
2 changes: 1 addition & 1 deletion client/src/pages/Auth/MainLoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const navigate = useNavigate();
description="Access academic resources, courses, and personal dashboard"
bgColor="text-blue-500"
borderColor="border-blue-500"
onClick={ ()=> navigate("/StudentDashboard")}
onClick={ ()=> navigate("/StudentDashboard/dashboard")}

/>
<LoginOption
Expand Down
5 changes: 3 additions & 2 deletions client/src/pages/Contact/ContactPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useState } from 'react';
import { Mail, Phone, MapPin, Clock, Send, ChevronDown} from 'lucide-react';
import Footer from '../../shared/Footer/Footer';
import faqData from './faqData.js';
import ServiceLayout from '../../layout/ServiceLayout.jsx';

const FAQItem = ({ question, answer }) => {
const [isOpen, setIsOpen] = useState(false);
Expand Down Expand Up @@ -199,9 +200,9 @@ const ContactPage = () => {
</div>

{/* Footer with conditional class */}
<Footer/>
{/* <Footer/> */}
</div>
);
};

export default ContactPage;
export default ServiceLayout()(ContactPage);
5 changes: 3 additions & 2 deletions client/src/pages/Courses/CoursesPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { Search, Clock, ArrowRight, GraduationCap } from 'lucide-react';
import courses from './utils/courses';
import categories from './utils/categories';
import Footer from '../../shared/Footer/Footer';
import ServiceLayout from '../../layout/ServiceLayout';

const CoursesPage = () => {
const [searchQuery, setSearchQuery] = useState('');
Expand Down Expand Up @@ -133,9 +134,9 @@ const CoursesPage = () => {
</div>
)}
</div>
<Footer/>
{/* <Footer/> */}
</div>
);
};

export default CoursesPage;
export default ServiceLayout()(CoursesPage);
File renamed without changes.
Loading

0 comments on commit a7ae9b4

Please sign in to comment.