diff --git a/my-app/src/pages/App.jsx b/my-app/src/pages/App.jsx index 4906db50..baf836f2 100644 --- a/my-app/src/pages/App.jsx +++ b/my-app/src/pages/App.jsx @@ -22,33 +22,6 @@ function App() {
- - {isPopupOpen && ( -
setIsPopupOpen(false)} - > -
e.stopPropagation()} - > -
- -
- -
-
- )} ); diff --git a/my-app/src/views/Components/CoursePagePopup.jsx b/my-app/src/views/Components/CoursePagePopup.jsx new file mode 100644 index 00000000..8a5239bf --- /dev/null +++ b/my-app/src/views/Components/CoursePagePopup.jsx @@ -0,0 +1,30 @@ +import React from 'react'; +import CourseView from '../CourseView'; + +function CoursePagePopup({ isOpen, onClose, course }) { + if (!isOpen || !course) return null; // Don't render if not open or course not selected + + return ( +
+
e.stopPropagation()} + > +
+ +
+ +
+
+ ); +} + +export default CoursePagePopup; diff --git a/my-app/src/views/CourseView.jsx b/my-app/src/views/CourseView.jsx index 3ec07834..225f9f86 100644 --- a/my-app/src/views/CourseView.jsx +++ b/my-app/src/views/CourseView.jsx @@ -1,61 +1,53 @@ import React from 'react'; +// import {model} from '/src/model.js'; -export default function CourseView(props) { +export default function CourseView({ course }) { + if (!course) return null; + + return ( -
+
{/* Course Title Section */} -
-

ID1203 - Best course in the Universe

+
+

+ {course.code} - {course.name} + ({course.credits} Credits) {/* Display Credits */} +

+
+
+
{/* Description Section */} -
-

- The course is an introduction to networking, protocols and communication. - - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - We study how large international networks are constructed from the individual computers, via local area, city and national networks. We use the Internet as or working example of such a network. The aim of the course is to give insights into both the theory and practice of the area. - - The focus of the course is on the protocols and algorithms used, and we will follow how they are used and implemented into the TCP/IP-stack - the basis of the Internet.

+
+

Course Description

+
+ {/* Prerequisite Graph Tree Section */} +
+

Prerequisite Graph Tree

+

Graph tree or prerequisite info will go here...

+
{/* Reviews Section */} -
-

Reviews

- {/* Placeholder for reviews */} -

Here would be some reviews of the course...

+
+

Reviews

+

Here would be some reviews of the course...

- {/* Prerequisite Graph Tree Section */} -
-

Prerequisite Graph Tree

- {/* Placeholder for graph tree */} -

Graph tree or prerequisite info will go here...

-
); } diff --git a/my-app/src/views/ListView.jsx b/my-app/src/views/ListView.jsx index 5f6512bf..127058dc 100644 --- a/my-app/src/views/ListView.jsx +++ b/my-app/src/views/ListView.jsx @@ -1,10 +1,15 @@ import React, { useState } from 'react'; import { Quantum } from 'ldrs/react'; import 'ldrs/react/Quantum.css'; +import CoursePagePopupComponent from '../views/Components/CoursePagePopup.jsx'; + function ListView(props) { const coursesToDisplay = props.searchResults.length > 0 ? props.searchResults : props.courses; const [readMoreState, setReadMoreState] = useState({}); + const [isPopupOpen, setIsPopupOpen] = useState(false); + const [selectedCourse, setSelectedCourse] = useState(null); + const toggleReadMore = (courseCode) => { setReadMoreState(prevState => ( @@ -19,12 +24,18 @@ function ListView(props) { props.addFavourite(course); } }; + return (
{coursesToDisplay.length > 0 ? ( coursesToDisplay.map((course) => (
{ + console.log('Clicked:', course); // check browser console + setSelectedCourse(course); + setIsPopupOpen(true); + }} key={course.code} className="p-5 hover:bg-blue-100 flex items-center border border-b-black border-solid w-full rounded-lg cursor-pointer" > @@ -54,7 +65,10 @@ function ListView(props) {
); }