Skip to content

Commit

Permalink
Allow the domain step to go back to Theme Showcase
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Oct 17, 2023
1 parent c009c2e commit 6f4f6a9
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions client/signup/steps/domains/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ export class RenderDomainsStep extends Component {
}

shouldHideNavButtons() {
return isWithThemeFlow( this.props.flowName ) || this.isTailoredFlow();
return this.isTailoredFlow();
}

renderContent() {
Expand Down Expand Up @@ -1274,7 +1274,15 @@ export class RenderDomainsStep extends Component {
return null;
}

const { isAllDomains, translate, isReskinned, userSiteCount } = this.props;
const {
flowName,
stepName,
stepSectionName,
isAllDomains,
translate,
isReskinned,
userSiteCount,
} = this.props;
const siteUrl = this.props.selectedSite?.URL;
const siteSlug = this.props.queryObject?.siteSlug;
const source = this.props.queryObject?.source;
Expand All @@ -1293,14 +1301,17 @@ export class RenderDomainsStep extends Component {
} else if ( isAllDomains ) {
backUrl = domainManagementRoot();
backLabelText = translate( 'Back to All Domains' );
} else if ( ! previousStepBackUrl && 'domain-transfer' === this.props.flowName ) {
} else if ( ! previousStepBackUrl && 'domain-transfer' === flowName ) {
backUrl = null;
backLabelText = null;
} else if ( 'with-plugin' === this.props.flowName ) {
} else if ( 'with-plugin' === flowName ) {
backUrl = '/plugins';
backLabelText = translate( 'Back to plugins' );
} else if ( isWithThemeFlow( flowName ) ) {
backUrl = '/themes';
backLabelText = translate( 'Back to themes' );
} else {
backUrl = getStepUrl( this.props.flowName, this.props.stepName, null, this.getLocale() );
backUrl = getStepUrl( flowName, stepName, null, this.getLocale() );

if ( 'site' === source && siteUrl ) {
backUrl = siteUrl;
Expand All @@ -1317,7 +1328,7 @@ export class RenderDomainsStep extends Component {
backLabelText = sitesBackLabelText;
}

const externalBackUrl = getExternalBackUrl( source, this.props.stepSectionName );
const externalBackUrl = getExternalBackUrl( source, stepSectionName );
if ( externalBackUrl ) {
backUrl = externalBackUrl;
backLabelText = translate( 'Back' );
Expand All @@ -1331,8 +1342,8 @@ export class RenderDomainsStep extends Component {

return (
<StepWrapper
flowName={ this.props.flowName }
stepName={ this.props.stepName }
flowName={ flowName }
stepName={ stepName }
backUrl={ backUrl }
positionInFlow={ this.props.positionInFlow }
headerText={ headerText }
Expand Down

0 comments on commit 6f4f6a9

Please sign in to comment.