From 58b52df098c9b25700d038565170474a9ef9d167 Mon Sep 17 00:00:00 2001 From: ihor-romaniuk Date: Wed, 25 Oct 2023 11:12:23 +0300 Subject: [PATCH] fix: sequence container width and responsive for sequence navigation block --- src/courseware/course/sequence/Sequence.jsx | 40 ++++++++++--------- .../SequenceNavigation.jsx | 3 +- .../course/sidebar/SidebarTriggers.jsx | 6 ++- .../course/sidebar/common/TriggerBase.jsx | 2 +- .../tabs/useIndexOfLastVisibleChild.js | 1 + src/index.scss | 20 +++++++++- 6 files changed, 47 insertions(+), 25 deletions(-) diff --git a/src/courseware/course/sequence/Sequence.jsx b/src/courseware/course/sequence/Sequence.jsx index 529c09b83b..c7b717a69f 100644 --- a/src/courseware/course/sequence/Sequence.jsx +++ b/src/courseware/course/sequence/Sequence.jsx @@ -140,26 +140,28 @@ const Sequence = ({ const gated = sequence && sequence.gatedContent !== undefined && sequence.gatedContent.gated; const defaultContent = ( -
+
- { - logEvent('edx.ui.lms.sequence.next_selected', 'top'); - handleNext(); - }} - onNavigate={(destinationUnitId) => { - logEvent('edx.ui.lms.sequence.tab_selected', 'top', destinationUnitId); - handleNavigate(destinationUnitId); - }} - previousHandler={() => { - logEvent('edx.ui.lms.sequence.previous_selected', 'top'); - handlePrevious(); - }} - /> - {shouldDisplayNotificationTriggerInSequence && } +
+ { + logEvent('edx.ui.lms.sequence.next_selected', 'top'); + handleNext(); + }} + onNavigate={(destinationUnitId) => { + logEvent('edx.ui.lms.sequence.tab_selected', 'top', destinationUnitId); + handleNavigate(destinationUnitId); + }} + previousHandler={() => { + logEvent('edx.ui.lms.sequence.previous_selected', 'top'); + handlePrevious(); + }} + /> + {shouldDisplayNotificationTriggerInSequence && } +
+ ); }; diff --git a/src/courseware/course/sidebar/SidebarTriggers.jsx b/src/courseware/course/sidebar/SidebarTriggers.jsx index 9ef7b724bb..cdc255d52d 100644 --- a/src/courseware/course/sidebar/SidebarTriggers.jsx +++ b/src/courseware/course/sidebar/SidebarTriggers.jsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; import React, { useContext } from 'react'; +import { breakpoints, useWindowSize } from '@edx/paragon'; import SidebarContext from './SidebarContext'; import { SIDEBAR_ORDER, SIDEBARS } from './sidebars'; @@ -8,6 +9,9 @@ const SidebarTriggers = () => { toggleSidebar, currentSidebar, } = useContext(SidebarContext); + + const isMobileView = useWindowSize().width < breakpoints.small.minWidth; + return (
{SIDEBAR_ORDER.map((sidebarId) => { @@ -15,7 +19,7 @@ const SidebarTriggers = () => { const isActive = sidebarId === currentSidebar; return (
diff --git a/src/courseware/course/sidebar/common/TriggerBase.jsx b/src/courseware/course/sidebar/common/TriggerBase.jsx index 16c2845041..5800fb55c8 100644 --- a/src/courseware/course/sidebar/common/TriggerBase.jsx +++ b/src/courseware/course/sidebar/common/TriggerBase.jsx @@ -8,7 +8,7 @@ const SidebarTriggerBase = ({ children, }) => (