fix: fixed expended view unit bar issue (#1356)

* fix: fixed expended view unit bar issue

* refactor: removed expanded width
This commit is contained in:
sundasnoreen12
2024-04-17 12:29:45 +05:00
committed by GitHub
parent a2c38112fb
commit 2da930f819

View File

@@ -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