From 54f1a1f703fb90c09ce04f328444ab2041720234 Mon Sep 17 00:00:00 2001 From: StevenDufresne Date: Tue, 21 Jan 2025 16:02:41 +0900 Subject: [PATCH 1/3] Remove loading state for Features. --- .../components/wp-checkout-order-summary.tsx | 56 ++----------------- 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx b/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx index ab5fe299f44fa..a08a48cf39341 100644 --- a/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx +++ b/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx @@ -146,14 +146,10 @@ export function CheckoutSummaryFeaturedList( { ? translate( 'WordPress.com Gift Subscription' ) : translate( 'Included with your purchase' ) } - { isCartUpdating ? ( - - ) : ( - - ) } + { ! isCartUpdating && ! hasRenewalInCart && ! isWcMobile && plan && hasMonthlyPlanInCart && ( @@ -232,16 +228,6 @@ function CheckoutSummaryPriceList() { ); } -export function LoadingCheckoutSummaryFeaturesList() { - return ( - <> - - - - - ); -} - function SwitchToAnnualPlan( { plan, onChangeSelection, @@ -999,40 +985,6 @@ const CheckoutSummaryTotal = styled( CheckoutSummaryLineItem )` } `; -const LoadingCopy = styled.p` - animation: ${ pulse } 1.5s ease-in-out infinite; - background: ${ ( props ) => props.theme.colors.borderColorLight }; - border-radius: 2px; - color: ${ ( props ) => props.theme.colors.borderColorLight }; - content: ''; - font-size: 14px; - height: 18px; - margin: 8px 0 0 26px; - padding: 0; - position: relative; - - ::before { - content: ''; - display: block; - position: absolute; - left: -26px; - top: 0; - width: 18px; - height: 18px; - background: ${ ( props ) => props.theme.colors.borderColorLight }; - border-radius: 100%; - } - - .rtl & { - margin: 8px 26px 0 0; - - ::before { - right: -26px; - left: auto; - } - } -`; - const SwitchToAnnualPlanButton = styled.button` text-align: left; text-decoration: underline; From fbc5aa904986e96bd088a7a688be24f7900119f7 Mon Sep 17 00:00:00 2001 From: StevenDufresne Date: Wed, 22 Jan 2025 09:46:43 +0900 Subject: [PATCH 2/3] Revert "Remove loading state for Features." This reverts commit 54f1a1f703fb90c09ce04f328444ab2041720234. --- .../components/wp-checkout-order-summary.tsx | 56 +++++++++++++++++-- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx b/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx index a08a48cf39341..ab5fe299f44fa 100644 --- a/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx +++ b/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx @@ -146,10 +146,14 @@ export function CheckoutSummaryFeaturedList( { ? translate( 'WordPress.com Gift Subscription' ) : translate( 'Included with your purchase' ) } - + { isCartUpdating ? ( + + ) : ( + + ) } { ! isCartUpdating && ! hasRenewalInCart && ! isWcMobile && plan && hasMonthlyPlanInCart && ( @@ -228,6 +232,16 @@ function CheckoutSummaryPriceList() { ); } +export function LoadingCheckoutSummaryFeaturesList() { + return ( + <> + + + + + ); +} + function SwitchToAnnualPlan( { plan, onChangeSelection, @@ -985,6 +999,40 @@ const CheckoutSummaryTotal = styled( CheckoutSummaryLineItem )` } `; +const LoadingCopy = styled.p` + animation: ${ pulse } 1.5s ease-in-out infinite; + background: ${ ( props ) => props.theme.colors.borderColorLight }; + border-radius: 2px; + color: ${ ( props ) => props.theme.colors.borderColorLight }; + content: ''; + font-size: 14px; + height: 18px; + margin: 8px 0 0 26px; + padding: 0; + position: relative; + + ::before { + content: ''; + display: block; + position: absolute; + left: -26px; + top: 0; + width: 18px; + height: 18px; + background: ${ ( props ) => props.theme.colors.borderColorLight }; + border-radius: 100%; + } + + .rtl & { + margin: 8px 26px 0 0; + + ::before { + right: -26px; + left: auto; + } + } +`; + const SwitchToAnnualPlanButton = styled.button` text-align: left; text-decoration: underline; From 1e04c2dd5eb6ef2d982029989be130ef2a5cf0e4 Mon Sep 17 00:00:00 2001 From: StevenDufresne Date: Wed, 22 Jan 2025 09:49:40 +0900 Subject: [PATCH 3/3] Remove the loading state but keep the skeleton which is used in the purchase modal. --- .../src/components/wp-checkout-order-summary.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx b/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx index ab5fe299f44fa..da028e6d34ddb 100644 --- a/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx +++ b/client/my-sites/checkout/src/components/wp-checkout-order-summary.tsx @@ -146,14 +146,10 @@ export function CheckoutSummaryFeaturedList( { ? translate( 'WordPress.com Gift Subscription' ) : translate( 'Included with your purchase' ) } - { isCartUpdating ? ( - - ) : ( - - ) } + { ! isCartUpdating && ! hasRenewalInCart && ! isWcMobile && plan && hasMonthlyPlanInCart && (