From f1dc646f83553b8db72eb0ac689eba9ce2f52608 Mon Sep 17 00:00:00 2001 From: Yan Sern Date: Thu, 12 Sep 2024 11:41:44 +0300 Subject: [PATCH] A4A Dev Sites: Update launch confirmation modal copy. (#94376) * Update launch confirmation modal copy. * Share the same agency billing message. Some structure cleanup. --- .../launch-confirmation-modal.tsx | 50 ++++++------- .../site-visibility/launch-site.jsx | 72 ++++++++----------- .../site-settings/site-visibility/styles.scss | 4 ++ 3 files changed, 57 insertions(+), 69 deletions(-) diff --git a/client/my-sites/site-settings/site-visibility/launch-confirmation-modal.tsx b/client/my-sites/site-settings/site-visibility/launch-confirmation-modal.tsx index f0e623c5b6d24..a903bcda1402d 100644 --- a/client/my-sites/site-settings/site-visibility/launch-confirmation-modal.tsx +++ b/client/my-sites/site-settings/site-visibility/launch-confirmation-modal.tsx @@ -12,40 +12,36 @@ const ActionButtons = styled.div( { type LaunchConfirmationModalProps = { onConfirmation: () => void; closeModal: () => void; - billingAgencyMessage: string; + message: string; }; export function LaunchConfirmationModal( { closeModal, - billingAgencyMessage, + message, onConfirmation, }: LaunchConfirmationModalProps ) { - // Not wrapped in translation to avoid request unconfirmed copy - const modalTitle = 'You’re about to update your production site'; + const modalTitle = translate( "You're about to launch this website" ); return ( - <> - - { billingAgencyMessage && ( -

- { billingAgencyMessage } -
- Are you sure you want to proceed? -

- ) } - - - - -
- + + { message &&

{ message }

} +

{ translate( 'Ready to launch?' ) }

+ + + + +
); } diff --git a/client/my-sites/site-settings/site-visibility/launch-site.jsx b/client/my-sites/site-settings/site-visibility/launch-site.jsx index 96429fab29a3e..154080bb55551 100644 --- a/client/my-sites/site-settings/site-visibility/launch-site.jsx +++ b/client/my-sites/site-settings/site-visibility/launch-site.jsx @@ -120,22 +120,40 @@ const LaunchSite = () => { window.location.href = `https://agencies.automattic.com/marketplace/checkout?referral_blog_id=${ siteId }`; }; - // Not wrapped in translation to avoid request unconfirmed copy - const billingAgencyMessage = - agencyLoading || agencyError ? ( - 'Once launched, your agency {agench-name} will be billed for this website in the next billing cycle.' - ) : ( - <> - Once launched, { agencyName } will be billed for this website in the next - billing cycle. - - ); + const agencyBillingMessage = + agencyLoading || agencyError + ? translate( "After launch, we'll bill your agency in the next billing cycle." ) + : translate( + "After launch, we'll bill {{strong}}%(agencyName)s{{/strong}} in the next billing cycle. With %(licenseCount)s production hosting license, you will be charged %(price)s / license / month. {{a}}Learn more.{{/a}}", + "After launch, we'll bill {{strong}}%(agencyName)s{{/strong}} in the next billing cycle. With %(licenseCount)s production hosting licenses, you will be charged %(price)s / license / month. {{a}}Learn more.{{/a}}", + { + count: existingWPCOMLicenseCount + 1, + args: { + agencyName: agencyName, + licenseCount: existingWPCOMLicenseCount + 1, + price, + }, + components: { + strong: , + a: ( + + ), + }, + comment: + 'agencyName: name of the agency that will be billed for the site; licenseCount: number of licenses the agency will be billed for; price: price per license', + } + ); return ( <> { isLaunchConfirmationModalOpen && ( { dispatchSiteLaunch(); @@ -157,37 +175,7 @@ const LaunchSite = () => { "Your site hasn't been launched yet. It's private; only you can see it until it is launched." ) }

- { isDevelopmentSite && ( - - { agencyLoading || agencyError - ? translate( 'After launch, we’ll bill your agency in the next billing cycle.' ) - : translate( - 'After launch, we’ll bill {{strong}}%(agencyName)s{{/strong}} in the next billing cycle. With %(licenseCount)s production hosting license, you will be charged %(price)s / license / month. {{a}}Learn more.{{/a}}', - 'After launch, we’ll bill {{strong}}%(agencyName)s{{/strong}} in the next billing cycle. With %(licenseCount)s production hosting licenses, you will be charged %(price)s / license / month. {{a}}Learn more.{{/a}}', - { - count: existingWPCOMLicenseCount + 1, - args: { - agencyName: agencyName, - licenseCount: existingWPCOMLicenseCount + 1, - price, - }, - components: { - strong: , - a: ( -
- ), - }, - comment: - 'agencyName: name of the agency that will be billed for the site; licenseCount: number of licenses the agency will be billed for; price: price per license', - } - ) } - - ) } + { isDevelopmentSite && { agencyBillingMessage } }
{ btnComponent }
{ isDevelopmentSite && ( diff --git a/client/my-sites/site-settings/site-visibility/styles.scss b/client/my-sites/site-settings/site-visibility/styles.scss index 2f5f4e209f7d9..00ca07ce05a36 100644 --- a/client/my-sites/site-settings/site-visibility/styles.scss +++ b/client/my-sites/site-settings/site-visibility/styles.scss @@ -13,3 +13,7 @@ margin-left: 20px; white-space: nowrap; } + +.site-settings__launch-confirmation-modal { + max-width: 60%; +}