-
Notifications
You must be signed in to change notification settings - Fork 4
improved courseView #35
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bc88f11
added loader
Dinoxh 4047fcf
Merge branch 'main' of https://github.com/InferenceKTH/Find-My-Next-C…
Dinoxh 30cde8a
Merge branch 'main' of https://github.com/InferenceKTH/Find-My-Next-C…
Dinoxh 4b6bdf5
Merge branch 'main' of https://github.com/InferenceKTH/Find-My-Next-C…
Dinoxh 2c07fff
Merge branch 'main' of https://github.com/InferenceKTH/Find-My-Next-C…
Dinoxh 346501a
Merge branch 'main' of https://github.com/InferenceKTH/Find-My-Next-C…
Dinoxh f00f0d2
Course page merged with main
LSKpr 8b50419
fav button fixed
LSKpr 730c13d
Merge remote-tracking branch 'origin' into course-page2
LSKpr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ( | ||
| <div | ||
| className="fixed backdrop-blur-sm inset-0 bg-transparent flex justify-end z-50" | ||
| onClick={onClose} | ||
| > | ||
| <div | ||
| className="bg-indigo-400/70 backdrop-blur-sm h-full w-3/4 flex flex-col overflow-auto" | ||
| onClick={(e) => e.stopPropagation()} | ||
| > | ||
| <div className="flex-1"> | ||
| <CourseView course={course} /> | ||
| </div> | ||
| <button | ||
| onClick={onClose} | ||
| className="px-4 py-2 bg-violet-500 text-white" | ||
| > | ||
| Close | ||
| </button> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default CoursePagePopup; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ( | ||
| <div style={{ margin: '20px' }}> | ||
| <div className="px-10 py-10 md:px-20 md:py-16 text-slate-900 space-y-12 font-sans"> | ||
| {/* Course Title Section */} | ||
| <div style={{ display: 'flex', flexDirection: 'column', marginBottom: '20px' }}> | ||
| <h2 style={{ fontSize: '36px', fontWeight: 'bold' }}>ID1203 - Best course in the Universe</h2> | ||
| <div> | ||
| <h2 className="text-5xl font-extrabold text-[#2e2e4f]"> | ||
| {course.code} - {course.name} | ||
| <span className="ml-4 text-lg text-violet-900">({course.credits} Credits)</span> {/* Display Credits */} | ||
| </h2> | ||
| </div> | ||
| <div> | ||
| <button | ||
| className="text-yellow-500 cursor-pointer" | ||
| onClick={(e) => { | ||
| e.stopPropagation(); // prevent popup from opening | ||
| handleFavouriteClick(course.code); | ||
| }} | ||
| > | ||
| {/* {model.favouriteCourses.includes(course.code) | ||
| ? 'Remove from Favourites' | ||
| : 'Add to Favourites'} */} | ||
| </button> | ||
| </div> | ||
|
|
||
| {/* Description Section */} | ||
| <div style={{ display: 'flex', flexDirection: 'column', marginBottom: '20px', color: 'white' }}> | ||
| <h3 style={{ fontSize: '24px', fontWeight: 'bold' }}> | ||
| 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. </h3> | ||
| <div> | ||
| <h3 className="text-2xl font-bold text-[#3d3d68] mb-4">Course Description</h3> | ||
| <div | ||
| className="text-lg leading-8 text-[#2c2c2c] tracking-wide prose prose-slate max-w-full" | ||
| dangerouslySetInnerHTML={{ __html: course.description }} | ||
| /> | ||
| </div> | ||
|
|
||
| {/* Prerequisite Graph Tree Section */} | ||
| <div> | ||
| <h3 className="text-2xl font-semibold text-[#2e2e4f]">Prerequisite Graph Tree</h3> | ||
| <p className="text-lg text-slate-700 leading-7">Graph tree or prerequisite info will go here...</p> | ||
| </div> | ||
| {/* Reviews Section */} | ||
| <div style={{ display: 'flex', flexDirection: 'column', marginBottom: '20px' }}> | ||
| <h3 style={{ fontFamily: 'Georgia, serif', fontSize: '24px' }}>Reviews</h3> | ||
| {/* Placeholder for reviews */} | ||
| <p style={{ fontSize: '16px' }}>Here would be some reviews of the course...</p> | ||
| <div> | ||
| <h3 className="text-2xl font-semibold text-[#2e2e4f]">Reviews</h3> | ||
| <p className="text-lg text-slate-700 leading-7">Here would be some reviews of the course...</p> | ||
| </div> | ||
|
|
||
| {/* Prerequisite Graph Tree Section */} | ||
| <div style={{ display: 'flex', flexDirection: 'column', marginBottom: '20px' }}> | ||
| <h3 style={{ fontFamily: 'Courier New, monospace', fontSize: '24px' }}>Prerequisite Graph Tree</h3> | ||
| {/* Placeholder for graph tree */} | ||
| <p style={{ fontSize: '16px' }}>Graph tree or prerequisite info will go here...</p> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The function 'handleFavouriteClick' is referenced but not defined in this component. Either define the function or remove this call to prevent runtime errors.