Skip to content

Commit 7cea73d

Browse files
committed
feat: Enable Unlik from library in container sidebars
1 parent 71816a2 commit 7cea73d

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/course-outline/outline-sidebar/info-sidebar/SectionInfoSidebar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const SectionSidebar = () => {
2727
sections,
2828
updateSectionOrderByIndex,
2929
openDeleteModal,
30+
openUnlinkModal,
3031
} = useCourseAuthoringContext();
3132

3233
const handlePublish = () => {
@@ -62,7 +63,7 @@ export const SectionSidebar = () => {
6263
onClickDuplicate: handleDuplicateSectionSubmit,
6364
onClickMoveUp: () => handleMove(-1),
6465
onClickMoveDown: () => handleMove(1),
65-
onClickUnlink: () => {},
66+
onClickUnlink: () => openUnlinkModal({ value: sectionData, sectionId }),
6667
onClickDelete: openDeleteModal,
6768
onClickViewLibrary: () => {},
6869
}}

src/course-outline/outline-sidebar/info-sidebar/SubsectionInfoSidebar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const SubsectionSidebar = () => {
3434
sections,
3535
updateSubsectionOrderByIndex,
3636
openDeleteModal,
37+
openUnlinkModal,
3738
} = useCourseAuthoringContext();
3839

3940
const handlePublish = () => {
@@ -104,7 +105,10 @@ export const SubsectionSidebar = () => {
104105
onClickDuplicate: handleDuplicateSubsectionSubmit,
105106
onClickMoveUp: () => handleMove(-1),
106107
onClickMoveDown: () => handleMove(1),
107-
onClickUnlink: () => {},
108+
onClickUnlink: () => openUnlinkModal({
109+
value: subsectionData,
110+
sectionId: selectedContainerState?.sectionId,
111+
}),
108112
onClickDelete: openDeleteModal,
109113
onClickViewLibrary: () => {},
110114
}}

src/course-outline/outline-sidebar/info-sidebar/UnitInfoSidebar.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const UnitSidebar = () => {
4242
sections,
4343
updateUnitOrderByIndex,
4444
openDeleteModal,
45+
openUnlinkModal,
4546
} = useCourseAuthoringContext();
4647

4748
const handlePublish = () => {
@@ -128,7 +129,11 @@ export const UnitSidebar = () => {
128129
onClickDuplicate: handleDuplicateUnitSubmit,
129130
onClickMoveUp: () => handleMove(-1),
130131
onClickMoveDown: () => handleMove(1),
131-
onClickUnlink: () => {},
132+
onClickUnlink: () => openUnlinkModal({
133+
value: unitData,
134+
sectionId: selectedContainerState?.sectionId,
135+
subsectionId: selectedContainerState?.subsectionId,
136+
}),
132137
onClickDelete: openDeleteModal,
133138
onClickViewLibrary: () => {},
134139
onClickCopy: () => {},

0 commit comments

Comments
 (0)