diff --git a/src/courseware/course/NotificationIcon.jsx b/src/courseware/course/NotificationIcon.jsx index da8f0112..ae8c08c5 100644 --- a/src/courseware/course/NotificationIcon.jsx +++ b/src/courseware/course/NotificationIcon.jsx @@ -5,7 +5,6 @@ import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; import { Icon } from '@edx/paragon'; import { WatchOutline } from '@edx/paragon/icons'; -import './NotificationIcon.scss'; import messages from './messages'; function NotificationIcon({ intl, status, notificationColor }) { diff --git a/src/courseware/course/sequence/Sequence.jsx b/src/courseware/course/sequence/Sequence.jsx index c56e4574..c274a65b 100644 --- a/src/courseware/course/sequence/Sequence.jsx +++ b/src/courseware/course/sequence/Sequence.jsx @@ -204,6 +204,7 @@ function Sequence({ sequenceId={sequenceId} unitId={unitId} unitLoadedHandler={handleUnitLoaded} + notificationTrayVisible={notificationTrayVisible} /** [MM-P2P] Experiment */ mmp2p={mmp2p} /> diff --git a/src/courseware/course/sequence/SequenceContent.jsx b/src/courseware/course/sequence/SequenceContent.jsx index d6eff201..110dd0c3 100644 --- a/src/courseware/course/sequence/SequenceContent.jsx +++ b/src/courseware/course/sequence/SequenceContent.jsx @@ -16,6 +16,7 @@ function SequenceContent({ sequenceId, unitId, unitLoadedHandler, + notificationTrayVisible, /** [MM-P2P] Experiment */ mmp2p, }) { @@ -61,6 +62,7 @@ function SequenceContent({ key={unitId} id={unitId} onLoaded={unitLoadedHandler} + notificationTrayVisible={notificationTrayVisible} /** [MM-P2P] Experiment */ mmp2p={mmp2p} /> @@ -73,6 +75,7 @@ SequenceContent.propTypes = { sequenceId: PropTypes.string.isRequired, unitId: PropTypes.string, unitLoadedHandler: PropTypes.func.isRequired, + notificationTrayVisible: PropTypes.bool.isRequired, intl: intlShape.isRequired, /** [MM-P2P] Experiment */ mmp2p: PropTypes.shape({ diff --git a/src/courseware/course/sequence/Unit.jsx b/src/courseware/course/sequence/Unit.jsx index 6c08d7cc..3da681be 100644 --- a/src/courseware/course/sequence/Unit.jsx +++ b/src/courseware/course/sequence/Unit.jsx @@ -85,6 +85,7 @@ function Unit({ onLoaded, id, intl, + notificationTrayVisible, /** [MM-P2P] Experiment */ mmp2p, }) { @@ -171,7 +172,7 @@ function Unit({ /> )} > - + )} { /** [MM-P2P] Experiment */ } @@ -252,6 +253,7 @@ Unit.propTypes = { id: PropTypes.string.isRequired, intl: intlShape.isRequired, onLoaded: PropTypes.func, + notificationTrayVisible: PropTypes.bool.isRequired, /** [MM-P2P] Experiment */ mmp2p: PropTypes.shape({ state: PropTypes.shape({ diff --git a/src/courseware/course/sequence/lock-paywall/LockPaywall.jsx b/src/courseware/course/sequence/lock-paywall/LockPaywall.jsx index c8b62935..97ebab25 100644 --- a/src/courseware/course/sequence/lock-paywall/LockPaywall.jsx +++ b/src/courseware/course/sequence/lock-paywall/LockPaywall.jsx @@ -1,22 +1,22 @@ import React from 'react'; import PropTypes from 'prop-types'; +import classNames from 'classnames'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCheck } from '@fortawesome/free-solid-svg-icons'; import { sendTrackEvent } from '@edx/frontend-platform/analytics'; import { FormattedMessage, injectIntl, intlShape } from '@edx/frontend-platform/i18n'; -import { - Alert, Icon, -} from '@edx/paragon'; +import { Alert } from '@edx/paragon'; import { Locked } from '@edx/paragon/icons'; import messages from './messages'; import certificateLocked from '../../../../generic/assets/edX_locked_certificate.png'; import { useModel } from '../../../../generic/model-store'; +import useWindowSize, { responsiveBreakpoints } from '../../../../generic/tabs/useWindowSize'; import { UpgradeButton } from '../../../../generic/upgrade-button'; -import './LockPaywall.scss'; function LockPaywall({ intl, courseId, + notificationTrayVisible, }) { const course = useModel('coursewareMeta', courseId); const { @@ -25,6 +25,18 @@ function LockPaywall({ verifiedMode, } = course; + // the following variables are set and used for resposive layout to work with + // whether the NotificationTray is open or not and if there's an offer with longer text + const shouldDisplayBulletPointsBelowCertificate = useWindowSize().width + <= responsiveBreakpoints.large.minWidth; + const shouldDisplayGatedContentOneColumn = useWindowSize().width <= responsiveBreakpoints.extraLarge.minWidth + && notificationTrayVisible; + const shouldDisplayGatedContentTwoColumns = useWindowSize().width < responsiveBreakpoints.large.minWidth + && notificationTrayVisible; + const shouldDisplayGatedContentTwoColumnsHalf = useWindowSize().width <= responsiveBreakpoints.large.minWidth + && !notificationTrayVisible; + const shouldWrapTextOnButton = useWindowSize().width > responsiveBreakpoints.extraSmall.minWidth; + if (!verifiedMode) { return null; } @@ -44,14 +56,6 @@ function LockPaywall({ }); }; - const lockIcon = ( -