Skip to content

Commit 2bb92c7

Browse files
authored
CIAB: update Checkout for Woo Hosted sites (#106584)
* Hide logo for Woo Hosted sites * Use WPcom colors for Woo Hosted
1 parent f0d603e commit 2bb92c7

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

client/layout/masterbar/checkout.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ const CheckoutMasterbar = ( {
3737
const leaveModalProps = useCheckoutLeaveModal( { siteUrl: siteSlug ?? '' } );
3838

3939
const getCheckoutType = () => {
40+
// Woo Hosted sites are supposed to default to WPcom colors, but without
41+
// a logo. We should update this once we have a better way to identify
42+
// Garden sites outside of the Hosting Dashboard.
43+
if ( isJetpackNotAtomic && siteSlug?.endsWith( '.commerce-garden.com' ) ) {
44+
return 'woo-hosted';
45+
}
46+
4047
if ( window.location.pathname.startsWith( '/checkout/jetpack' ) || isJetpackNotAtomic ) {
4148
return 'jetpack';
4249
}
@@ -54,7 +61,8 @@ const CheckoutMasterbar = ( {
5461
const checkoutType = getCheckoutType();
5562

5663
const showCloseButton =
57-
isLeavingAllowed && ( checkoutType === 'wpcom' || checkoutType === 'gravatar' );
64+
isLeavingAllowed &&
65+
( checkoutType === 'wpcom' || checkoutType === 'gravatar' || checkoutType === 'woo-hosted' );
5866

5967
return (
6068
<Masterbar

client/my-sites/checkout/src/components/checkout-main.tsx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,9 @@ export default function CheckoutMain( {
548548
[ dataForProcessor, translate ]
549549
);
550550

551+
// Gravatar Theme
551552
let gravatarColors = {};
552553
let gravatarFontWeights = {};
553-
554554
if ( isGravatarDomain ) {
555555
gravatarColors = {
556556
primary: '#1d4fc4',
@@ -565,18 +565,25 @@ export default function CheckoutMain( {
565565
};
566566
}
567567

568-
const jetpackColors = isJetpackNotAtomic
569-
? {
570-
primary: colors[ 'Jetpack Green' ],
571-
primaryBorder: colors[ 'Jetpack Green 80' ],
572-
primaryOver: colors[ 'Jetpack Green 60' ],
573-
success: colors[ 'Jetpack Green' ],
574-
discount: colors[ 'Jetpack Green' ],
575-
highlight: colors[ 'WordPress Blue 50' ],
576-
highlightBorder: colors[ 'WordPress Blue 80' ],
577-
highlightOver: colors[ 'WordPress Blue 60' ],
578-
}
579-
: {};
568+
// Jetpack Theme
569+
// Woo Hosted sites are technically Jetpack, but are supposed to default to
570+
// WPcom colors. We should update this once we have a better way to identify
571+
// Garden sites outside of the Hosting Dashboard.
572+
const jetpackColors =
573+
isJetpackNotAtomic && ! updatedSiteSlug?.endsWith( '.commerce-garden.com' )
574+
? {
575+
primary: colors[ 'Jetpack Green' ],
576+
primaryBorder: colors[ 'Jetpack Green 80' ],
577+
primaryOver: colors[ 'Jetpack Green 60' ],
578+
success: colors[ 'Jetpack Green' ],
579+
discount: colors[ 'Jetpack Green' ],
580+
highlight: colors[ 'WordPress Blue 50' ],
581+
highlightBorder: colors[ 'WordPress Blue 80' ],
582+
highlightOver: colors[ 'WordPress Blue 60' ],
583+
}
584+
: {};
585+
586+
// A4A Theme
580587
const a4aColors =
581588
sitelessCheckoutType === 'a4a'
582589
? {
@@ -588,6 +595,7 @@ export default function CheckoutMain( {
588595
highlightOver: colors[ 'Automattic Blue 60' ],
589596
}
590597
: {};
598+
591599
const theme = {
592600
...checkoutTheme,
593601
colors: { ...checkoutTheme.colors, ...gravatarColors, ...jetpackColors, ...a4aColors },

0 commit comments

Comments
 (0)