Skip to content

Commit 2da930f

Browse files
fix: fixed expended view unit bar issue (openedx#1356)
* fix: fixed expended view unit bar issue * refactor: removed expanded width
1 parent a2c3811 commit 2da930f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/courseware/course/sequence/sequence-navigation/SequenceNavigationTabs.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
import React from 'react';
1+
import React, { useContext } from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
4+
import { getConfig } from '@edx/frontend-platform';
45

56
import UnitButton from './UnitButton';
67
import SequenceNavigationDropdown from './SequenceNavigationDropdown';
78
import useIndexOfLastVisibleChild from '../../../../generic/tabs/useIndexOfLastVisibleChild';
89
import { useIsOnXLDesktop } from './hooks';
10+
import SidebarContext from '../../sidebar/SidebarContext';
11+
import NewSidebarContext from '../../new-sidebar/SidebarContext';
912

1013
const SequenceNavigationTabs = ({
1114
unitIds, unitId, showCompletion, onNavigate,
1215
}) => {
16+
const enableNewSidebar = getConfig().ENABLE_NEW_SIDEBAR;
17+
const sidebarContext = enableNewSidebar === 'true' ? NewSidebarContext : SidebarContext;
18+
const { currentSidebar } = useContext(sidebarContext);
1319
const [
1420
indexOfLastVisibleChild,
1521
containerRef,
@@ -23,7 +29,7 @@ const SequenceNavigationTabs = ({
2329
<div
2430
ref={containerRef}
2531
className={classNames('sequence-navigation-tabs-container', {
26-
'navigation-tab-width': isOnXLDesktop,
32+
'navigation-tab-width': isOnXLDesktop && currentSidebar,
2733
})}
2834
>
2935
<div

0 commit comments

Comments
 (0)