Skip to content

Commit 83a58a2

Browse files
committed
feat: expand collapse button bar
1 parent dafe4dd commit 83a58a2

2 files changed

Lines changed: 38 additions & 19 deletions

File tree

src/course-outline/CourseOutline.tsx

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import {
88
TransitionReplace,
99
Toast,
1010
StandardModal,
11+
Button,
12+
ActionRow,
1113
} from '@openedx/paragon';
1214
import { Helmet } from 'react-helmet';
13-
import { CheckCircle as CheckCircleIcon } from '@openedx/paragon/icons';
15+
import { CheckCircle as CheckCircleIcon, CloseFullscreen, OpenInFull } from '@openedx/paragon/icons';
1416
import { useSelector } from 'react-redux';
1517
import {
1618
arrayMove,
@@ -61,6 +63,7 @@ import {
6163
} from './drag-helper/utils';
6264
import { useCourseOutline } from './hooks';
6365
import messages from './messages';
66+
import headerMessages from './header-navigations/messages';
6467
import { getTagsExportFile } from './data/api';
6568
import OutlineAddChildButtons from './OutlineAddChildButtons';
6669
import { StatusBar } from './status-bar/StatusBar';
@@ -333,6 +336,24 @@ const CourseOutline = () => {
333336
/>
334337
)}
335338
/>
339+
{showNewActionsBar
340+
? (
341+
<StatusBar
342+
courseId={courseId}
343+
isLoading={isLoading}
344+
statusBarData={statusBarData}
345+
notificationCount={3}
346+
/>
347+
) : (
348+
<LegacyStatusBar
349+
courseId={courseId}
350+
isLoading={isLoading}
351+
statusBarData={statusBarData}
352+
openEnableHighlightsModal={openEnableHighlightsModal}
353+
handleVideoSharingOptionChange={handleVideoSharingOptionChange}
354+
/>
355+
)}
356+
<hr className='mt-4 mb-0 w-100 text-light-400' />
336357
<Layout
337358
lg={[{ span: 9 }, { span: 3 }]}
338359
md={[{ span: 9 }, { span: 3 }]}
@@ -343,24 +364,22 @@ const CourseOutline = () => {
343364
<Layout.Element>
344365
<article>
345366
<div>
367+
{showNewActionsBar && <ActionRow className='mt-3'>
368+
{Boolean(sectionsList.length) && (
369+
<Button
370+
variant="outline-primary"
371+
id="expand-collapse-all-button"
372+
data-testid="expand-collapse-all-button"
373+
iconBefore={isSectionsExpanded ? CloseFullscreen : OpenInFull}
374+
onClick={headerNavigationsActions.handleExpandAll}
375+
>
376+
{isSectionsExpanded
377+
? intl.formatMessage(headerMessages.collapseAllButton)
378+
: intl.formatMessage(headerMessages.expandAllButton)}
379+
</Button>
380+
)}
381+
</ActionRow>}
346382
<section className="course-outline-section">
347-
{showNewActionsBar
348-
? (
349-
<StatusBar
350-
courseId={courseId}
351-
isLoading={isLoading}
352-
statusBarData={statusBarData}
353-
notificationCount={3}
354-
/>
355-
) : (
356-
<LegacyStatusBar
357-
courseId={courseId}
358-
isLoading={isLoading}
359-
statusBarData={statusBarData}
360-
openEnableHighlightsModal={openEnableHighlightsModal}
361-
handleVideoSharingOptionChange={handleVideoSharingOptionChange}
362-
/>
363-
)}
364383
{!errors?.outlineIndexApi && (
365384
<div className="pt-4">
366385
{sections.length ? (

src/generic/sub-header/SubHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const SubHeader = ({
2626
hideBorder = false,
2727
withSubHeaderContent,
2828
}: SubHeaderProps) => (
29-
<div className={`${!hideBorder && 'border-bottom border-light-400'} mb-3`}>
29+
<div className={`${!hideBorder && 'border-bottom border-light-400'} mb-2`}>
3030
{breadcrumbs && (
3131
<div className="sub-header-breadcrumbs">{breadcrumbs}</div>
3232
)}

0 commit comments

Comments
 (0)