@@ -3,13 +3,12 @@ import { SchoolOutline } from '@openedx/paragon/icons';
33
44import { SidebarContent , SidebarSection , SidebarTitle } from '@src/generic/sidebar' ;
55
6- import messages from './messages' ;
76import contentMessages from '@src/library-authoring/add-content/messages' ;
87import { useCourseAuthoringContext } from '@src/CourseAuthoringContext' ;
9- import { ComponentPicker } from '../../library-authoring' ;
10- import { ContentType } from '../../library-authoring/routes' ;
118import { SidebarFilters } from '@src/library-authoring/library-filters/SidebarFilters' ;
12- import { Button , Stack , Tab , Tabs } from '@openedx/paragon' ;
9+ import {
10+ Button , Stack , Tab , Tabs ,
11+ } from '@openedx/paragon' ;
1312import { getItemIcon } from '@src/generic/block-type-utils' ;
1413import { useSelector } from 'react-redux' ;
1514import { getSectionsList } from '@src/course-outline/data/selectors' ;
@@ -18,6 +17,9 @@ import { ComponentSelectedEvent } from '@src/library-authoring/common/context/Co
1817import { COMPONENT_TYPES } from '@src/generic/block-type-utils/constants' ;
1918import { ContainerType } from '@src/generic/key-utils' ;
2019import { XBlock } from '@src/data/types' ;
20+ import { ContentType } from '../../library-authoring/routes' ;
21+ import { ComponentPicker } from '../../library-authoring' ;
22+ import messages from './messages' ;
2123
2224type ContainerTypes = 'unit' | 'subsection' | 'section' ;
2325
@@ -37,7 +39,7 @@ const getLastEditableParent = (blockList: Array<XBlock>) => {
3739 index ++ ;
3840 }
3941 return undefined ;
40- }
42+ } ;
4143
4244/** Add Content Button */
4345const AddContentButton = ( { name, blockType } : AddContentButtonProps ) => {
@@ -68,7 +70,7 @@ const AddContentButton = ({ name, blockType } : AddContentButtonProps) => {
6870 default :
6971 // istanbul ignore next: unreachable
7072 throw new Error ( `Unrecognized block type ${ blockType } ` ) ;
71- } ;
73+ }
7274 } , [
7375 blockType ,
7476 handleNewSectionSubmit ,
@@ -84,7 +86,7 @@ const AddContentButton = ({ name, blockType } : AddContentButtonProps) => {
8486 className = "m-2"
8587 iconBefore = { getItemIcon ( blockType ) }
8688 onClick = { onCreateContent }
87- disabled = { ( ! lastSection && blockType === 'subsection' ) || ( ! lastSubsection && blockType === 'unit' ) }
89+ disabled = { ( ! lastSection && blockType === 'subsection' ) || ( ! lastSubsection && blockType === 'unit' ) }
8890 >
8991 { name }
9092 </ Button >
@@ -99,21 +101,21 @@ const AddNewContent = () => {
99101 < AddContentButton
100102 key = "section"
101103 name = { intl . formatMessage ( contentMessages . sectionButton ) }
102- blockType = ' section'
104+ blockType = " section"
103105 />
104106 < AddContentButton
105107 key = "subsection"
106108 name = { intl . formatMessage ( contentMessages . subsectionButton ) }
107- blockType = ' subsection'
109+ blockType = " subsection"
108110 />
109111 < AddContentButton
110112 key = "unit"
111113 name = { intl . formatMessage ( contentMessages . unitButton ) }
112- blockType = ' unit'
114+ blockType = " unit"
113115 />
114116 </ Stack >
115117 ) ;
116- }
118+ } ;
117119
118120/** Add Existing Content Tab Section */
119121const ShowLibraryContent = ( ) => {
@@ -160,7 +162,7 @@ const ShowLibraryContent = () => {
160162 default :
161163 // istanbul ignore next: unreachable
162164 throw new Error ( `Unrecognized block type ${ blockType } ` ) ;
163- } ;
165+ }
164166 } , [
165167 courseUsageKey ,
166168 handleAddSectionFromLibrary ,
@@ -171,9 +173,9 @@ const ShowLibraryContent = () => {
171173 ] ) ;
172174
173175 const allowedBlocks = useMemo ( ( ) => {
174- let blocks : ContainerTypes [ ] = [ 'section' ] ;
175- if ( lastSection ) blocks . push ( 'subsection' ) ;
176- if ( lastSubsection ) blocks . push ( 'unit' ) ;
176+ const blocks : ContainerTypes [ ] = [ 'section' ] ;
177+ if ( lastSection ) { blocks . push ( 'subsection' ) ; }
178+ if ( lastSubsection ) { blocks . push ( 'unit' ) ; }
177179 return blocks ;
178180 } , [ lastSection , lastSubsection , sectionsList ] ) ;
179181
@@ -188,7 +190,7 @@ const ShowLibraryContent = () => {
188190 onComponentSelected = { onComponentSelected }
189191 />
190192 ) ;
191- }
193+ } ;
192194
193195/** Tabs Component */
194196const AddTabs = ( ) => {
@@ -209,7 +211,7 @@ const AddTabs = () => {
209211 </ Tab >
210212 </ Tabs >
211213 ) ;
212- }
214+ } ;
213215
214216/** Main Sidebar Component */
215217export const AddSidebar = ( ) => {
0 commit comments