From b098f911d4ae3e83cbc80b0c669d58ffe851e55c Mon Sep 17 00:00:00 2001 From: Chris Holder Date: Fri, 31 Jan 2025 15:19:53 -0600 Subject: [PATCH] Clean up scrolling on disabled modal --- .../onboarding/subscribe-modal/index.tsx | 136 +++++++++--------- .../onboarding/subscribe-modal/style.scss | 21 ++- 2 files changed, 85 insertions(+), 72 deletions(-) diff --git a/client/reader/onboarding/subscribe-modal/index.tsx b/client/reader/onboarding/subscribe-modal/index.tsx index 9232513f4f19c..ce3a4dfc542c8 100644 --- a/client/reader/onboarding/subscribe-modal/index.tsx +++ b/client/reader/onboarding/subscribe-modal/index.tsx @@ -306,80 +306,82 @@ const SubscribeModal: React.FC< SubscribeModalProps > = ( { isOpen, onClose } ) - { promptVerification && } -
-
-

{ __( "Discover sites that you'll love" ) }

-

- { __( - 'Preview sites by clicking below, then subscribe to any site that inspires you.' +

+ { promptVerification && } +
+
+

+ { __( "Discover sites that you'll love" ) } +

+

+ { __( + 'Preview sites by clicking below, then subscribe to any site that inspires you.' + ) } +

+ { isLoading && } + { ! isLoading && combinedRecommendations.length === 0 && ( +

{ __( 'No recommendations available at the moment.' ) }

) } -

- { isLoading && } - { ! isLoading && combinedRecommendations.length === 0 && ( -

{ __( 'No recommendations available at the moment.' ) }

- ) } - { ! isLoading && combinedRecommendations.length > 0 && ( -
- { displayedRecommendations.map( ( site: CardData ) => ( - handleItemClick( site ) } - isSelected={ selectedSite?.feed_ID === site.feed_ID } - onFollowToggle={ ( following: boolean ) => - handleFollowToggle( site, following ) - } - /> - ) ) } -
- ) } - { currentPage < maxPages && ( - - ) } -
-
-
- { selectedSite && ( - <> -
-

{ formatUrl( selectedSite.site_URL ) }

-
-
- 0 && ( +
+ { displayedRecommendations.map( ( site: CardData ) => ( + handleItemClick( site ) } + isSelected={ selectedSite?.feed_ID === site.feed_ID } + onFollowToggle={ ( following: boolean ) => + handleFollowToggle( site, following ) + } /> -
- + ) ) } +
+ ) } + { currentPage < maxPages && ( + ) }
+
+
+ { selectedSite && ( + <> +
+

{ formatUrl( selectedSite.site_URL ) }

+
+
+ +
+ + ) } +
+
diff --git a/client/reader/onboarding/subscribe-modal/style.scss b/client/reader/onboarding/subscribe-modal/style.scss index 85f23ad168454..cc3a6305a2ae1 100644 --- a/client/reader/onboarding/subscribe-modal/style.scss +++ b/client/reader/onboarding/subscribe-modal/style.scss @@ -41,11 +41,6 @@ body.is-reader-page .subscribe-modal__preview-column .reader__card.card.is-place } } - &__disabled-for-verification { - opacity: 0.5; - pointer-events: none; - } - &__site-list-column { flex: 1; padding: 20px 20px 0; @@ -154,4 +149,20 @@ body.is-reader-page .subscribe-modal__preview-column .reader__card.card.is-place } } } + + &.is-disabled { + .subscribe-modal__container { + height: calc( 100vh - 188px ); // Modal margin + modal padding + modal heading + overflow: hidden; + padding: 1px; + } + .subscribe-modal__content { + opacity: 0.5; + pointer-events: none; + } + .subscribe-modal__preview-stream-container, + .subscribe-modal__site-list-column { + overflow-y: hidden; + } + } }