Skip to content

Commit

Permalink
fix: fixed expended view unit bar issue (#1356)
Browse files Browse the repository at this point in the history
* fix: fixed expended view unit bar issue

* refactor: removed expanded width
  • Loading branch information
sundasnoreen12 authored Apr 17, 2024
1 parent a2c3811 commit 2da930f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 2da930f

Please sign in to comment.