Skip to content

Commit

Permalink
add as a default route
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyakrishnai committed Apr 4, 2024
1 parent 4a06bdf commit 54481f1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import { stepTheFork } from '../../../steps/TheFork/step';
import { ThemeProvider } from '../../ThemeContextProvider';
import themeToggleHOC from '../themeToggleHOC';
import Footer from '../../Footer';
import { stepMigration } from '../../../steps/SiteGen/Migration/step';

const SiteBuild = () => {
const location = useLocation();
Expand All @@ -67,6 +68,7 @@ const SiteBuild = () => {
onboardingFlow,
currentData,
currentStep,
currentRoute,
lastChapter,
socialData,
firstStep,
Expand Down Expand Up @@ -99,6 +101,7 @@ const SiteBuild = () => {
initialize: select( nfdOnboardingStore ).getInitialize(),
pluginInstallHash:
select( nfdOnboardingStore ).getPluginInstallHash(),
currentRoute: select( nfdOnboardingStore ).getCurrentStepPath(),
};
},
[ location.pathname ]
Expand Down Expand Up @@ -431,6 +434,7 @@ const SiteBuild = () => {

const isForkStep =
currentStep === stepTheFork ||
currentRoute === stepMigration.path ||
window.nfdOnboarding.currentFlow === 'sitegen';
// wrapping the NewfoldInterfaceSkeleton with the HOC to make 'theme' available
const ThemedNewfoldInterfaceSkeleton = themeToggleHOC(
Expand Down
2 changes: 2 additions & 0 deletions src/OnboardingSPA/data/flows/ecommerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { filter } from 'lodash';
import { store } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import { stepTheFork } from '../../steps/TheFork/step';
import { stepMigration } from '../../steps/SiteGen/Migration/step';

export const pages = [ indexPage, errorPage ];

Expand Down Expand Up @@ -50,6 +51,7 @@ export const getSteps = ( chapters = initialChapters ) => {
export const getRoutes = ( chapters = initialChapters ) => {
let routes = [ ...pages ];
routes.push( stepTheFork );
routes.push( stepMigration );
routes.push( stepWelcome );
chapters.forEach( ( chapter ) => {
routes = routes.concat( [
Expand Down
3 changes: 1 addition & 2 deletions src/OnboardingSPA/data/flows/sitegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { siteGenCore } from '../../chapters/siteGen/core';
import { errorPage } from '../../pages/ErrorPage/page';
import { indexPage } from '../../pages/IndexPage/page';
import { stepSiteGenWelcome } from '../../steps/SiteGen/Welcome/step';
import { stepMigration } from '../../steps/SiteGen/Migration/step';
import { stepTheFork } from '../../steps/TheFork/step';

export const pages = [ indexPage, errorPage ];
Expand All @@ -25,7 +24,7 @@ export const getSteps = ( chapters = initialChapters ) => {

export const getRoutes = ( chapters = initialChapters ) => {
let routes = [ ...pages ];
routes.push( stepTheFork, stepSiteGenWelcome, stepMigration );
routes.push( stepTheFork, stepSiteGenWelcome );
chapters.forEach( ( chapter ) => {
routes = routes.concat( [
...chapter.steps,
Expand Down
2 changes: 1 addition & 1 deletion src/OnboardingSPA/utils/api/siteGen.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ export async function getSiteMigrateUrl() {
url: migrateRestURL( 'migrate/connect' ),
} ).then()
);
}
}

0 comments on commit 54481f1

Please sign in to comment.