Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A4A: Add Hosting page v3 feature flag. #97057

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion client/a8c-for-agencies/sections/marketplace/controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import AssignLicense from './assign-license';
import Checkout from './checkout';
import { MARKETPLACE_TYPE_REFERRAL } from './hoc/with-marketplace-type';
import HostingOverview from './hosting-overview';
import HostingOverviewV3 from './hosting-overview-v3';
import { getValidHostingSection } from './lib/hosting';
import { getValidBrand } from './lib/product-brand';
import PressableOverview from './pressable-overview';
Expand Down Expand Up @@ -62,11 +63,17 @@ export const marketplaceHostingContext: Callback = ( context, next ) => {

const section = getValidHostingSection( context.params.section );

const isV3Enabled = isEnabled( 'a4a-hosting-page-redesign-v3' );

context.secondary = <MarketplaceSidebar path={ context.path } />;
context.primary = (
<>
<PageViewTracker title="Marketplace > Hosting" path={ context.path } />
<HostingOverview defaultMarketplaceType={ purchaseType } section={ section } />
{ isV3Enabled ? (
<HostingOverviewV3 />
) : (
<HostingOverview defaultMarketplaceType={ purchaseType } section={ section } />
) }
</>
);
next();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import page from '@automattic/calypso-router';
import { useBreakpoint } from '@automattic/viewport-react';
import { useTranslate } from 'i18n-calypso';
import Layout from 'calypso/a8c-for-agencies/components/layout';
import LayoutBody from 'calypso/a8c-for-agencies/components/layout/body';
import LayoutHeader, {
LayoutHeaderActions as Actions,
LayoutHeaderBreadcrumb as Breadcrumb,
} from 'calypso/a8c-for-agencies/components/layout/header';
import LayoutTop from 'calypso/a8c-for-agencies/components/layout/top';
import PressableUsageLimitNotice from 'calypso/a8c-for-agencies/components/pressable-usage-limit-notice';
import MobileSidebarNavigation from 'calypso/a8c-for-agencies/components/sidebar/mobile-sidebar-navigation';
import {
A4A_MARKETPLACE_CHECKOUT_LINK,
A4A_MARKETPLACE_LINK,
} from 'calypso/a8c-for-agencies/components/sidebar-menu/lib/constants';
import QueryProductsList from 'calypso/components/data/query-products-list';
import ReferralToggle from '../common/referral-toggle';
import useShoppingCart from '../hooks/use-shopping-cart';
import ShoppingCart from '../shopping-cart';

export default function HostingOverviewV3() {
const translate = useTranslate();
const isNarrowView = useBreakpoint( '<660px' );

const { selectedCartItems, onRemoveCartItem, showCart, setShowCart, toggleCart } =
useShoppingCart();

return (
<Layout
className="hosting-overview-v3"
title={ isNarrowView ? translate( 'Hosting' ) : translate( 'Hosting Marketplace' ) }
wide
withBorder
>
<LayoutTop>
<PressableUsageLimitNotice />
<LayoutHeader>
<Breadcrumb
items={ [
{
label: translate( 'Marketplace' ),
href: A4A_MARKETPLACE_LINK,
},
{
label: translate( 'Hosting' ),
},
] }
/>

<Actions className="a4a-marketplace__header-actions">
<MobileSidebarNavigation />
<ReferralToggle />
<ShoppingCart
showCart={ showCart }
setShowCart={ setShowCart }
toggleCart={ toggleCart }
items={ selectedCartItems }
onRemoveItem={ onRemoveCartItem }
onCheckout={ () => {
page( A4A_MARKETPLACE_CHECKOUT_LINK );
} }
/>
</Actions>
</LayoutHeader>
</LayoutTop>

<LayoutBody className="hosting-overview-v3__body">
<QueryProductsList currency="USD" />
Hosting Overview V3
{ /* Content will go here */ }
</LayoutBody>
</Layout>
);
}
1 change: 1 addition & 0 deletions config/a8c-for-agencies-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"a4a-automated-referrals": true,
"a4a-partner-directory": false,
"a4a-hosting-page-redesign": true,
"a4a-hosting-page-redesign-v3": true,
"a4a-dev-sites": true,
"a4a-migrations-page-v2": true,
"a8c-for-agencies-agency-tier": true,
Expand Down
1 change: 1 addition & 0 deletions config/a8c-for-agencies-horizon.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"a4a-automated-referrals": true,
"a4a-partner-directory": false,
"a4a-hosting-page-redesign": true,
"a4a-hosting-page-redesign-v3": true,
"a4a-dev-sites": true,
"a4a-migrations-page-v2": true,
"a8c-for-agencies-agency-tier": true,
Expand Down
1 change: 1 addition & 0 deletions config/a8c-for-agencies-production.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"a4a-automated-referrals": true,
"a4a-partner-directory": false,
"a4a-hosting-page-redesign": true,
"a4a-hosting-page-redesign-v3": false,
"a4a-dev-sites": true,
"a4a-migrations-page-v2": true,
"a8c-for-agencies-agency-tier": true,
Expand Down
1 change: 1 addition & 0 deletions config/a8c-for-agencies-stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"a4a-automated-referrals": true,
"a4a-partner-directory": false,
"a4a-hosting-page-redesign": true,
"a4a-hosting-page-redesign-v3": false,
"a4a-dev-sites": true,
"a4a-migrations-page-v2": true,
"a8c-for-agencies-agency-tier": true,
Expand Down
Loading