From 34a424d0c8473fb4cfeb5889646712121df6a4de Mon Sep 17 00:00:00 2001 From: DustyReagan Date: Fri, 20 Sep 2024 09:42:07 -0500 Subject: [PATCH 1/3] Make Home and WP Admin buttons always CTA --- .../site-preview-pane/dotcom-preview-pane.tsx | 11 +---------- .../site-preview-pane/preview-pane-header-buttons.tsx | 10 ++-------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/client/hosting/sites/components/site-preview-pane/dotcom-preview-pane.tsx b/client/hosting/sites/components/site-preview-pane/dotcom-preview-pane.tsx index 73df5d5dd9baa8..fd39e07be3d2b6 100644 --- a/client/hosting/sites/components/site-preview-pane/dotcom-preview-pane.tsx +++ b/client/hosting/sites/components/site-preview-pane/dotcom-preview-pane.tsx @@ -34,7 +34,6 @@ interface Props { selectedSiteFeaturePreview: React.ReactNode; closeSitePreviewPane: () => void; changeSitePreviewPane: ( siteId: number ) => void; - sectionName?: string; } const OVERLAY_MODAL_SELECTORS = [ @@ -43,12 +42,6 @@ const OVERLAY_MODAL_SELECTORS = [ 'div.help-center__container:not(.is-minimized)', ]; -type HeaderButtonsProps = { - focusRef: React.RefObject< HTMLButtonElement >; - itemData: ItemData; - closeSitePreviewPane: () => void; -}; - const DotcomPreviewPane = ( { site, selectedSiteFeature, @@ -200,9 +193,7 @@ const DotcomPreviewPane = ( { itemPreviewPaneHeaderExtraProps={ { externalIconSize: 16, siteIconFallback: 'first-grapheme', - headerButtons: ( props: HeaderButtonsProps ) => ( - - ), + headerButtons: PreviewPaneHeaderButtons, subtitleExtra: () => ( site.is_wpcom_staging_site || isStagingStatusFinished ) && ( diff --git a/client/hosting/sites/components/site-preview-pane/preview-pane-header-buttons.tsx b/client/hosting/sites/components/site-preview-pane/preview-pane-header-buttons.tsx index dfa83cbc312e57..e66c02fc55ed96 100644 --- a/client/hosting/sites/components/site-preview-pane/preview-pane-header-buttons.tsx +++ b/client/hosting/sites/components/site-preview-pane/preview-pane-header-buttons.tsx @@ -14,16 +14,10 @@ type Props = { sectionName?: string; }; -const PreviewPaneHeaderButtons = ( { - focusRef, - closeSitePreviewPane, - itemData, - sectionName, -}: Props ) => { +const PreviewPaneHeaderButtons = ( { focusRef, closeSitePreviewPane, itemData }: Props ) => { const adminButtonRef = useRef< HTMLButtonElement | null >( null ); const { adminLabel, adminUrl } = useSiteAdminInterfaceData( itemData.blogId ); const { __ } = useI18n(); - const isHostingOverview = sectionName === 'dotcom-hosting'; return ( <> @@ -31,7 +25,7 @@ const PreviewPaneHeaderButtons = ( { { __( 'Close' ) }