Skip to content

Commit 7eecf3d

Browse files
committed
feat: update unit title plugin (#1643)
This PR updates the unit title plugin to include all the elements that are part of the unit title, which includes the unit title, bookmark button, and navigation buttons (if left sidebar navigation is enabled).
1 parent fb0a969 commit 7eecf3d

File tree

7 files changed

+155
-284
lines changed

7 files changed

+155
-284
lines changed

src/courseware/course/sequence/Unit/__snapshots__/index.test.jsx.snap

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/courseware/course/sequence/Unit/index.jsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { useIntl } from '@edx/frontend-platform/i18n';
88
import { useModel } from '@src/generic/model-store';
99
import { usePluginsCallback } from '@src/generic/plugin-store';
1010

11-
import BookmarkButton from '../../bookmark/BookmarkButton';
1211
import messages from '../messages';
1312
import ContentIFrame from './ContentIFrame';
1413
import UnitSuspense from './UnitSuspense';
@@ -33,7 +32,6 @@ const Unit = ({
3332
const examAccess = useExamAccess({ id });
3433
const shouldDisplayHonorCode = useShouldDisplayHonorCode({ courseId, id });
3534
const unit = useModel(modelKeys.units, id);
36-
const isProcessing = unit.bookmarkedUpdateState === 'loading';
3735
const view = authenticatedUser ? views.student : views.public;
3836
const shouldDisplayUnitPreview = pathname.startsWith('/preview') && isOriginalUserStaff;
3937

@@ -50,19 +48,7 @@ const Unit = ({
5048

5149
return (
5250
<div className="unit">
53-
<div className="d-flex justify-content-between">
54-
<div className="mb-0">
55-
<h3 className="h3">{unit.title}</h3>
56-
<UnitTitleSlot courseId={courseId} unitId={id} unitTitle={unit.title} />
57-
</div>
58-
{isEnabledOutlineSidebar && renderUnitNavigation(true)}
59-
</div>
60-
<p className="sr-only">{formatMessage(messages.headerPlaceholder)}</p>
61-
<BookmarkButton
62-
unitId={unit.id}
63-
isBookmarked={unit.bookmarked}
64-
isProcessing={isProcessing}
65-
/>
51+
<UnitTitleSlot unitId={id} {...{ unit, isEnabledOutlineSidebar, renderUnitNavigation }} />
6652
<UnitSuspense {...{ courseId, id }} />
6753
<ContentIFrame
6854
elementId="unit-iframe"

0 commit comments

Comments
 (0)