Skip to content

Commit a16cc64

Browse files
committed
feat: Add links to course home and about.
Add a menu linking to the course about page. This page is actually being overridden by our plugin so we can now easily show on one page most of the overrides that our plugin makes. We also added some links to the actual course content given that this is the learner home and we should probably let them access the course content.
1 parent 5d5c68f commit a16cc64

File tree

1 file changed

+41
-7
lines changed

1 file changed

+41
-7
lines changed

frontend/src/plugin.jsx

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ import {
1010
Collapsible,
1111
Button,
1212
Spinner,
13+
Dropdown,
14+
IconButton,
15+
Icon,
1316
} from "@openedx/paragon";
14-
import { Archive, Unarchive } from "@openedx/paragon/icons";
17+
import { Archive, Unarchive, MoreVert } from "@openedx/paragon/icons";
1518

1619
const CourseList = ({ courseListData }) => {
1720
const [archivedCourses, setArchivedCourses] = useState(new Set());
@@ -202,14 +205,45 @@ const CourseList = ({ courseListData }) => {
202205
className="mb-4"
203206
>
204207
<Card>
205-
<Card.ImageCap
206-
src={getConfig().LMS_BASE_URL + courseData.course.bannerImgSrc}
207-
alt={courseData.course.courseName}
208-
/>
208+
<a href={courseData.courseRun?.homeUrl || '#'}>
209+
<Card.ImageCap
210+
src={getConfig().LMS_BASE_URL + courseData.course.bannerImgSrc}
211+
alt={courseData.course.courseName}
212+
/>
213+
</a>
209214
<Card.Header
210-
title={courseData.course.courseName}
215+
title={
216+
<a href={courseData.courseRun?.homeUrl || '#'}>
217+
{courseData.course.courseName}
218+
</a>
219+
}
211220
subtitle={courseData.course.courseNumber}
212-
actions={isArchived && <Badge variant="secondary">Archived</Badge>}
221+
actions={
222+
<>
223+
{isArchived && <Badge variant="secondary" className="me-2">Archived</Badge>}
224+
<Dropdown>
225+
<Dropdown.Toggle
226+
id={`course-menu-${courseData.cardId}`}
227+
as={IconButton}
228+
src={MoreVert}
229+
iconAs={Icon}
230+
variant="primary"
231+
aria-label="More actions"
232+
/>
233+
<Dropdown.Menu>
234+
{courseData.course.socialShareUrl && (
235+
<Dropdown.Item
236+
href={courseData.course.socialShareUrl}
237+
target="_blank"
238+
rel="noopener noreferrer"
239+
>
240+
View Course About Page
241+
</Dropdown.Item>
242+
)}
243+
</Dropdown.Menu>
244+
</Dropdown>
245+
</>
246+
}
213247
/>
214248
<Card.Section>
215249
{courseData.course.shortDescription && (

0 commit comments

Comments
 (0)