Skip to content

Commit

Permalink
Revert "Add sites migration banner (#95298)" (#95388)
Browse files Browse the repository at this point in the history
This reverts commit 2e315c8.
  • Loading branch information
renatho authored Oct 15, 2024
1 parent c128f4b commit 3f41086
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 195 deletions.
7 changes: 3 additions & 4 deletions client/hosting/sites/components/dotcom-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@
}
}

.sites-banner-container {
.sites-a8c-for-agencies-banner-container {
display: flex;
justify-content: center;
}

.sites-banner {
width: 100%;
.sites-a8c-for-agencies-banner {
margin-inline: 16px;

.banner__action {
Expand Down Expand Up @@ -635,7 +634,7 @@
}
}

.sites-banner-container {
.sites-a8c-for-agencies-banner-container {
display: none;
}
}
Expand Down

This file was deleted.

51 changes: 44 additions & 7 deletions client/hosting/sites/components/sites-dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Gridicon } from '@automattic/components';
import { localizeUrl, useHasEnTranslation } from '@automattic/i18n-utils';
import {
type SiteExcerptData,
SitesSortKey,
Expand Down Expand Up @@ -26,6 +28,7 @@ import LayoutHeader, {
} from 'calypso/a8c-for-agencies/components/layout/header';
import LayoutTop from 'calypso/a8c-for-agencies/components/layout/top';
import { GuidedTourContextProvider } from 'calypso/a8c-for-agencies/data/guided-tours/guided-tour-context';
import Banner from 'calypso/components/banner';
import DocumentHead from 'calypso/components/data/document-head';
import { useSiteExcerptsQuery } from 'calypso/data/sites/use-site-excerpts-query';
import { isP2Theme } from 'calypso/lib/site/utils';
Expand All @@ -46,7 +49,6 @@ import {
} from '../onboarding-tours';
import { DOTCOM_OVERVIEW, FEATURE_TO_ROUTE_MAP } from './site-preview-pane/constants';
import DotcomPreviewPane from './site-preview-pane/dotcom-preview-pane';
import SitesDashboardBannersManager from './sites-dashboard-banners-manager';
import SitesDashboardHeader from './sites-dashboard-header';
import DotcomSitesDataViews, { useSiteStatusGroups } from './sites-dataviews';
import { getSitesPagination } from './sites-dataviews/utils';
Expand Down Expand Up @@ -129,6 +131,8 @@ const SitesDashboard = ( {
[ 'theme_slug' ]
);

const hasEnTranslation = useHasEnTranslation();

useShowSiteCreationNotice( allSites, newSiteID );
useShowSiteTransferredNotice();

Expand Down Expand Up @@ -268,7 +272,7 @@ const SitesDashboard = ( {
}, [ dataViewsState.filters, siteStatusGroups ] );

// Filter sites list by status group.
const { currentStatusGroup, statuses } = useSitesListGrouping( allSites, {
const { currentStatusGroup } = useSitesListGrouping( allSites, {
status: statusSlug || 'all',
showHidden: true,
} );
Expand Down Expand Up @@ -350,6 +354,8 @@ const SitesDashboard = ( {
const hideListing = false;
const isNarrowView = false;

const showA8CForAgenciesBanner = paginatedSites.length >= 5;

const dashboardTitle = siteType === 'p2' ? translate( 'P2s' ) : translate( 'Sites' );

return (
Expand Down Expand Up @@ -377,11 +383,42 @@ const SitesDashboard = ( {
</LayoutTop>

<DocumentHead title={ dashboardTitle } />
<SitesDashboardBannersManager
sitesStatuses={ statuses }
sitesCount={ paginatedSites.length }
/>

{ showA8CForAgenciesBanner && (
<div className="sites-a8c-for-agencies-banner-container">
<Banner
callToAction={ translate( 'Learn more {{icon/}}', {
components: {
icon: <Gridicon icon="external" />,
},
} ) }
className="sites-a8c-for-agencies-banner"
description={
hasEnTranslation(
"Earn up to 50% revenue share and get volume discounts on WordPress.com hosting when you migrate sites to our platform and promote Automattic's products to clients."
)
? translate(
"Earn up to 50% revenue share and get volume discounts on WordPress.com hosting when you migrate sites to our platform and promote Automattic's products to clients."
)
: translate(
'Manage multiple WordPress sites from one place, get volume discounts on hosting products, and earn up to 50% revenue share when you migrate sites to our platform and refer our products to clients.'
)
}
dismissPreferenceName="dismissible-card-a8c-for-agencies-sites"
event="learn-more"
horizontal
href={ localizeUrl(
'https://wordpress.com/for-agencies?ref=wpcom-sites-dashboard'
) }
target="_blank"
title={
hasEnTranslation( "Building sites for customers? Here's how to earn more." )
? translate( "Building sites for customers? Here's how to earn more." )
: translate( 'Managing multiple sites? Meet our agency hosting' )
}
tracksClickName="calypso_sites_dashboard_a4a_banner_click"
/>
</div>
) }
<DotcomSitesDataViews
sites={ paginatedSites }
isLoading={ isLoading || ! initialSortApplied }
Expand Down

This file was deleted.

0 comments on commit 3f41086

Please sign in to comment.