Skip to content

Commit

Permalink
Merge pull request #375 from newfold-labs/enhance/fork-logic
Browse files Browse the repository at this point in the history
Improve fork logic to switch based on the brand config.
  • Loading branch information
arunshenoy99 authored Nov 30, 2023
2 parents 4c51613 + e481d6c commit 2efbdac
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/OnboardingSPA/steps/TheFork/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { HEADER_SITEGEN } from '../../../constants';
import { useNavigate } from 'react-router-dom';

import { Button } from '@wordpress/components';
import { SITEGEN_FLOW } from '../../data/flows/constants';
import { DEFAULT_FLOW, SITEGEN_FLOW } from '../../data/flows/constants';

import { resolveGetDataForFlow } from '../../data/flows';
import { validateFlow } from '../../data/flows/utils';
Expand Down Expand Up @@ -65,7 +65,7 @@ const TheFork = () => {

const oldFlow = window.nfdOnboarding?.oldFlow
? window.nfdOnboarding.oldFlow
: window.nfdOnboarding.currentFlow;
: DEFAULT_FLOW;
return (
<CommonLayout
isCentered
Expand All @@ -75,12 +75,14 @@ const TheFork = () => {
The Fork
</h1>
<div className="nfd-onboarding-step--site-gen__fork__buttons">
<Button
className="nfd-onboarding-step--site-gen__fork__buttons__button"
onClick={ () => switchFlow( SITEGEN_FLOW ) }
>
Goto sitegen flow
</Button>
{ validateFlow( brandConfig, SITEGEN_FLOW ) && (
<Button
className="nfd-onboarding-step--site-gen__fork__buttons__button"
onClick={ () => switchFlow( SITEGEN_FLOW ) }
>
Goto sitegen flow
</Button>
) }
<Button
className="nfd-onboarding-step--site-gen__fork__buttons__button"
onClick={ () => switchFlow( oldFlow ) }
Expand Down

0 comments on commit 2efbdac

Please sign in to comment.