fix: fixed expended view unit bar issue (#1356)
* fix: fixed expended view unit bar issue * refactor: removed expanded width
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
import React from 'react';
|
||||
import React, { useContext } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { getConfig } from '@edx/frontend-platform';
|
||||
|
||||
import UnitButton from './UnitButton';
|
||||
import SequenceNavigationDropdown from './SequenceNavigationDropdown';
|
||||
import useIndexOfLastVisibleChild from '../../../../generic/tabs/useIndexOfLastVisibleChild';
|
||||
import { useIsOnXLDesktop } from './hooks';
|
||||
import SidebarContext from '../../sidebar/SidebarContext';
|
||||
import NewSidebarContext from '../../new-sidebar/SidebarContext';
|
||||
|
||||
const SequenceNavigationTabs = ({
|
||||
unitIds, unitId, showCompletion, onNavigate,
|
||||
}) => {
|
||||
const enableNewSidebar = getConfig().ENABLE_NEW_SIDEBAR;
|
||||
const sidebarContext = enableNewSidebar === 'true' ? NewSidebarContext : SidebarContext;
|
||||
const { currentSidebar } = useContext(sidebarContext);
|
||||
const [
|
||||
indexOfLastVisibleChild,
|
||||
containerRef,
|
||||
@@ -23,7 +29,7 @@ const SequenceNavigationTabs = ({
|
||||
<div
|
||||
ref={containerRef}
|
||||
className={classNames('sequence-navigation-tabs-container', {
|
||||
'navigation-tab-width': isOnXLDesktop,
|
||||
'navigation-tab-width': isOnXLDesktop && currentSidebar,
|
||||
})}
|
||||
>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user