From 730b70156b0084fb1a55e45d25bced59ef6c0131 Mon Sep 17 00:00:00 2001 From: escapemanuele Date: Mon, 30 Sep 2024 22:36:17 +0200 Subject: [PATCH 1/2] Add flow title when no pagetitle --- client/landing/stepper/declarative-flow/internals/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/landing/stepper/declarative-flow/internals/index.tsx b/client/landing/stepper/declarative-flow/internals/index.tsx index c79de6b0fd3e7..ec72e5a328218 100644 --- a/client/landing/stepper/declarative-flow/internals/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/index.tsx @@ -5,6 +5,7 @@ import { } from '@automattic/onboarding'; import { useSelect } from '@wordpress/data'; import { useI18n } from '@wordpress/react-i18n'; +import { useTranslate } from 'i18n-calypso'; import React, { useEffect, lazy } from 'react'; import Modal from 'react-modal'; import { generatePath, useParams } from 'react-router'; @@ -75,6 +76,7 @@ export const FlowRenderer: React.FC< { flow: Flow } > = ( { flow } ) => { const currentStepRoute = params.step || ''; const isLoggedIn = useSelector( isUserLoggedIn ); const { lang = null } = useParams(); + const translate = useTranslate(); // Start tracking performance for this step. useStartStepperPerformanceTracking( params.flow || '', currentStepRoute ); @@ -194,6 +196,8 @@ export const FlowRenderer: React.FC< { flow: Flow } > = ( { flow } ) => { } else if ( isSenseiFlow( flow.name ) ) { return __( 'Course Creator' ); } + + return flow.title ?? translate( 'Create a site' ); }; useSignUpStartTracking( { flow } ); From 649d35b37673ced59dd3c0546732bb945b1118a6 Mon Sep 17 00:00:00 2001 From: escapemanuele Date: Mon, 30 Sep 2024 22:52:16 +0200 Subject: [PATCH 2/2] Simpilify document head title --- .../stepper/declarative-flow/internals/index.tsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/client/landing/stepper/declarative-flow/internals/index.tsx b/client/landing/stepper/declarative-flow/internals/index.tsx index ec72e5a328218..6e127bf1576ea 100644 --- a/client/landing/stepper/declarative-flow/internals/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/index.tsx @@ -1,11 +1,6 @@ -import { - isNewsletterOrLinkInBioFlow, - isSenseiFlow, - isWooExpressFlow, -} from '@automattic/onboarding'; +import { isWooExpressFlow } from '@automattic/onboarding'; import { useSelect } from '@wordpress/data'; import { useI18n } from '@wordpress/react-i18n'; -import { useTranslate } from 'i18n-calypso'; import React, { useEffect, lazy } from 'react'; import Modal from 'react-modal'; import { generatePath, useParams } from 'react-router'; @@ -76,7 +71,6 @@ export const FlowRenderer: React.FC< { flow: Flow } > = ( { flow } ) => { const currentStepRoute = params.step || ''; const isLoggedIn = useSelector( isUserLoggedIn ); const { lang = null } = useParams(); - const translate = useTranslate(); // Start tracking performance for this step. useStartStepperPerformanceTracking( params.flow || '', currentStepRoute ); @@ -191,13 +185,7 @@ export const FlowRenderer: React.FC< { flow: Flow } > = ( { flow } ) => { }; const getDocumentHeadTitle = () => { - if ( isNewsletterOrLinkInBioFlow( flow.name ) ) { - return flow.title; - } else if ( isSenseiFlow( flow.name ) ) { - return __( 'Course Creator' ); - } - - return flow.title ?? translate( 'Create a site' ); + return flow.title ?? __( 'Create a site' ); }; useSignUpStartTracking( { flow } );