feat: Add NotificationTray persistence by course (#772)

REV-2424
This commit is contained in:
julianajlk
2021-12-21 13:50:07 -05:00
committed by GitHub
parent de49e8b271
commit 2bf4f2a0b5
6 changed files with 137 additions and 11 deletions

View File

@@ -44,7 +44,7 @@ function SequenceNavigation({
sequence.gatedContent !== undefined && sequence.gatedContent.gated
) : undefined;
const shouldDisplayNotificationTrigger = useWindowSize().width < responsiveBreakpoints.small.minWidth;
const shouldDisplayNotificationTriggerInSequence = useWindowSize().width < responsiveBreakpoints.small.minWidth;
const renderUnitButtons = () => {
if (isLocked) {
@@ -76,7 +76,7 @@ function SequenceNavigation({
return (
<Button variant="link" className="next-btn" onClick={buttonOnClick} disabled={disabled} iconAfter={nextArrow}>
{shouldDisplayNotificationTrigger ? null : buttonText}
{shouldDisplayNotificationTriggerInSequence ? null : buttonText}
</Button>
);
};
@@ -84,9 +84,9 @@ function SequenceNavigation({
const prevArrow = isRtl(getLocale()) ? ChevronRight : ChevronLeft;
return sequenceStatus === LOADED && (
<nav id="courseware-sequenceNavigation" className={classNames('sequence-navigation', className)} style={{ width: shouldDisplayNotificationTrigger ? '90%' : null }}>
<nav id="courseware-sequenceNavigation" className={classNames('sequence-navigation', className)} style={{ width: shouldDisplayNotificationTriggerInSequence ? '90%' : null }}>
<Button variant="link" className="previous-btn" onClick={previousSequenceHandler} disabled={isFirstUnit} iconBefore={prevArrow}>
{shouldDisplayNotificationTrigger ? null : intl.formatMessage(messages.previousButton)}
{shouldDisplayNotificationTriggerInSequence ? null : intl.formatMessage(messages.previousButton)}
</Button>
{renderUnitButtons()}
{renderNextButton()}