Skip to content

Commit

Permalink
Removed error state from fork and welcome step
Browse files Browse the repository at this point in the history
  • Loading branch information
girish-lokapure committed Mar 6, 2024
1 parent 3591087 commit 3f1ea43
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
ACTION_ONBOARDING_CHAPTER_STARTED,
} from '../../../utils/analytics/hiive/constants';
import { SITEGEN_FLOW } from '../../../data/flows/constants';
import { stepTheFork } from '../../../steps/TheFork/step';

// Wrapping the NewfoldInterfaceSkeleton with the HOC to make theme available
const ThemedNewfoldInterfaceSkeleton = themeToggleHOC(
Expand Down Expand Up @@ -93,7 +94,8 @@ const SiteGen = () => {
const prevSiteGenErrorStatus = useRef();

async function syncStoreToDB() {
if ( currentData ) {
// The First Fork Step doesn't have any Store changes
if ( currentData && location?.pathname !== stepTheFork.path ) {
//Set the Flow Data and sync store and DB
const result = await setFlow( currentData );
if ( result?.error !== null ) {
Expand Down
51 changes: 24 additions & 27 deletions src/OnboardingSPA/steps/SiteGen/Welcome/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { store as nfdOnboardingStore } from '../../../store';
import { HEADER_SITEGEN } from '../../../../constants';
import getContents from './contents';
import OrbAnimation from '../../../components/OrbAnimation';
import SitegenAiStateHandler from '../../../components/StateHandlers/SitegenAi';

const SiteGenWelcome = () => {
const {
Expand All @@ -30,33 +29,31 @@ const SiteGenWelcome = () => {

const content = getContents();
return (
<SitegenAiStateHandler>
<CommonLayout className="nfd-onboarding-step--site-gen__welcome">
<div className="nfd-onboarding-step--site-gen__welcome__container">
<div className="nfd-onboarding-step--site-gen__welcome__container__orb">
<OrbAnimation height={ `100px` } />
</div>
<div className="nfd-onboarding-step--site-gen__welcome__container__heading">
<div className="nfd-onboarding-step--site-gen__welcome__container__heading__image"></div>
<p className="nfd-onboarding-step--site-gen__welcome__container__heading__text">
{ content.heading }
</p>
</div>
<div className="nfd-onboarding-step--site-gen__welcome__container__sub-heading">
<p className="nfd-onboarding-step--site-gen__welcome__container__sub-heading__text">
{ content.subHeading }
</p>
</div>
<NextButtonSiteGen
className={
'nfd-onboarding-step--site-gen__welcome--button'
}
text={ content.buttonText }
showChevronRight={ false }
/>
<CommonLayout className="nfd-onboarding-step--site-gen__welcome">
<div className="nfd-onboarding-step--site-gen__welcome__container">
<div className="nfd-onboarding-step--site-gen__welcome__container__orb">
<OrbAnimation height={ `100px` } />
</div>
</CommonLayout>
</SitegenAiStateHandler>
<div className="nfd-onboarding-step--site-gen__welcome__container__heading">
<div className="nfd-onboarding-step--site-gen__welcome__container__heading__image"></div>
<p className="nfd-onboarding-step--site-gen__welcome__container__heading__text">
{ content.heading }
</p>
</div>
<div className="nfd-onboarding-step--site-gen__welcome__container__sub-heading">
<p className="nfd-onboarding-step--site-gen__welcome__container__sub-heading__text">
{ content.subHeading }
</p>
</div>
<NextButtonSiteGen
className={
'nfd-onboarding-step--site-gen__welcome--button'
}
text={ content.buttonText }
showChevronRight={ false }
/>
</div>
</CommonLayout>
);
};

Expand Down
85 changes: 41 additions & 44 deletions src/OnboardingSPA/steps/TheFork/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { DEFAULT_FLOW } from '../../data/flows/constants';
import HeadingWithSubHeading from '../../components/HeadingWithSubHeading/SiteGen/index';
import StartOptions from '../../components/StartOptions';
import getContents from './contents';
import SitegenAiStateHandler from '../../components/StateHandlers/SitegenAi';
import {
OnboardingEvent,
sendOnboardingEvent,
Expand Down Expand Up @@ -65,51 +64,49 @@ const TheFork = () => {
};
const content = getContents();
return (
<SitegenAiStateHandler>
<CommonLayout
isCentered
className="nfd-onboarding-step--site-gen__fork"
>
<HeadingWithSubHeading
title={ content.heading }
subtitle={ content.subheading }
/>
<StartOptions
questionnaire={ content.questionnaire }
oldFlow={ oldFlow }
options={ content.options }
/>
<br />
<br />
{ migrationUrl && (
<a
className="nfd-onboarding-step--site-gen__fork__importsite"
href={ migrationUrl }
target={ '_blank' }
rel={ 'noreferrer' }
onClick={ () =>
trackOnboardingEvent(
new OnboardingEvent(
ACTION_SITEGEN_FORK_OPTION_SELECTED,
'MIGRATE'
)
<CommonLayout
isCentered
className="nfd-onboarding-step--site-gen__fork"
>
<HeadingWithSubHeading
title={ content.heading }
subtitle={ content.subheading }
/>
<StartOptions
questionnaire={ content.questionnaire }
oldFlow={ oldFlow }
options={ content.options }
/>
<br />
<br />
{ migrationUrl && (
<a
className="nfd-onboarding-step--site-gen__fork__importsite"
href={ migrationUrl }
target={ '_blank' }
rel={ 'noreferrer' }
onClick={ () =>
trackOnboardingEvent(
new OnboardingEvent(
ACTION_SITEGEN_FORK_OPTION_SELECTED,
'MIGRATE'
)
}
>
{ content.importtext }
</a>
) }
<span
role="button"
tabIndex={ 0 }
className="nfd-onboarding-step--site-gen__fork__exit"
onClick={ () => handleForkExit() }
onKeyDown={ () => handleForkExit() }
)
}
>
{ content.exitToWordPress }
</span>
</CommonLayout>
</SitegenAiStateHandler>
{ content.importtext }
</a>
) }
<span
role="button"
tabIndex={ 0 }
className="nfd-onboarding-step--site-gen__fork__exit"
onClick={ () => handleForkExit() }
onKeyDown={ () => handleForkExit() }
>
{ content.exitToWordPress }
</span>
</CommonLayout>
);
};

Expand Down

0 comments on commit 3f1ea43

Please sign in to comment.