Skip to content

Commit 2950e4b

Browse files
LSKprDinoxh
andauthored
Course page2 (#36)
* added loader * Course page merged with main * fav button fixed * show less/more --------- Co-authored-by: Sami Al Saati <sami.alsaati@hotmail.com> Co-authored-by: Kacper Lisik <lisik@kth.se>
1 parent 637c00f commit 2950e4b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

my-app/src/views/CourseView.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import PrerequisiteTree from "./PrerequisiteTree.jsx";
3+
34
// import {model} from '/src/model.js';
45

56
export default function CourseView({ course }) {
@@ -49,12 +50,14 @@ export default function CourseView({ course }) {
4950
<p className="text-lg text-slate-700 leading-7">Here would be some reviews of the course...</p>
5051
</div>
5152

53+
5254
{/* Prerequisite Graph Tree Section */}
5355
<div style={{ display: 'flex', flexDirection: 'column', marginBottom: '20px' }}>
5456
<h3 style={{ fontFamily: 'Courier New, monospace', fontSize: '24px' }}>Prerequisite Graph Tree</h3>
5557
{/* Placeholder for graph tree */}
5658
<PrerequisiteTree />
5759
</div>
60+
5861
</div>
5962
);
6063
}

my-app/src/views/ListView.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ function ListView(props) {
5353
{course.description.length > 150 && (
5454
<span
5555
className="text-blue-500 cursor-pointer"
56-
onClick={() => toggleReadMore(course.code)}
56+
onClick={(e) => {
57+
e.stopPropagation(); // Prevent the event from bubbling up.
58+
toggleReadMore(course.code);
59+
}}
5760
>
5861
{readMoreState[course.code]
5962
?

0 commit comments

Comments
 (0)