Skip to content

Commit

Permalink
Add flow title when no pagetitle
Browse files Browse the repository at this point in the history
  • Loading branch information
escapemanuele committed Sep 30, 2024
1 parent a78ea20 commit 730b701
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/landing/stepper/declarative-flow/internals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 } );
Expand Down

0 comments on commit 730b701

Please sign in to comment.