Skip to content

Commit 701b263

Browse files
committed
Lint Fix
1 parent 97e023a commit 701b263

File tree

3 files changed

+108
-104
lines changed

3 files changed

+108
-104
lines changed

src/OnboardingSPA/components/StartOptions/index.js

Lines changed: 71 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ import { ACTION_SITEGEN_FORK_OPTION_SELECTED } from '../../utils/analytics/hiive
2323
import OrbAnimation from '../OrbAnimation';
2424
import { pluginDashboardPage } from '../../../constants';
2525

26-
const StartOptions = ({
26+
const StartOptions = ( {
2727
questionnaire,
2828
oldFlow,
2929
largeOption,
3030
smallOptions,
31-
}) => {
31+
} ) => {
3232
const navigate = useNavigate();
3333
const {
3434
brandConfig,
@@ -37,82 +37,83 @@ const StartOptions = ({
3737
migrationUrl,
3838
canMigrateSite,
3939
allSteps,
40-
} = useSelect((select) => {
40+
} = useSelect( ( select ) => {
4141
return {
42-
brandConfig: select(nfdOnboardingStore).getNewfoldBrandConfig(),
42+
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
4343
hireProUrl:
44-
select(nfdOnboardingStore).getfullServiceCreativeTeamUrl(),
45-
currentData: select(nfdOnboardingStore).getCurrentOnboardingData(),
46-
allSteps: select(nfdOnboardingStore).getAllSteps(),
47-
canMigrateSite: select(nfdOnboardingStore).canMigrateSite(),
48-
migrationUrl: select(nfdOnboardingStore).getMigrationUrl(),
44+
select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
45+
currentData:
46+
select( nfdOnboardingStore ).getCurrentOnboardingData(),
47+
allSteps: select( nfdOnboardingStore ).getAllSteps(),
48+
canMigrateSite: select( nfdOnboardingStore ).canMigrateSite(),
49+
migrationUrl: select( nfdOnboardingStore ).getMigrationUrl(),
4950
};
50-
});
51+
} );
5152
const {
5253
updateAllSteps,
5354
updateTopSteps,
5455
updateRoutes,
5556
updateDesignRoutes,
5657
updateInitialize,
5758
setCurrentOnboardingData,
58-
} = useDispatch(nfdOnboardingStore);
59+
} = useDispatch( nfdOnboardingStore );
5960

60-
const switchFlow = (newFlow) => {
61-
if (!validateFlow(brandConfig, newFlow)) {
61+
const switchFlow = ( newFlow ) => {
62+
if ( ! validateFlow( brandConfig, newFlow ) ) {
6263
return false;
6364
}
6465
const currentFlow = window.nfdOnboarding.currentFlow;
65-
const getData = resolveGetDataForFlow(newFlow);
66+
const getData = resolveGetDataForFlow( newFlow );
6667
const data = getData();
67-
updateAllSteps(data.steps);
68-
updateTopSteps(data?.topSteps);
69-
updateRoutes(data.routes);
70-
updateDesignRoutes(data?.designRoutes);
71-
if (SITEGEN_FLOW !== currentFlow) {
68+
updateAllSteps( data.steps );
69+
updateTopSteps( data?.topSteps );
70+
updateRoutes( data.routes );
71+
updateDesignRoutes( data?.designRoutes );
72+
if ( SITEGEN_FLOW !== currentFlow ) {
7273
window.nfdOnboarding.oldFlow = currentFlow;
7374
}
7475

7576
window.nfdOnboarding.currentFlow = newFlow;
7677
currentData.activeFlow = newFlow;
7778
currentData.continueWithoutAi = false;
78-
setCurrentOnboardingData(currentData);
79-
if (SITEGEN_FLOW !== newFlow) {
80-
updateInitialize(true);
79+
setCurrentOnboardingData( currentData );
80+
if ( SITEGEN_FLOW !== newFlow ) {
81+
updateInitialize( true );
8182
}
82-
navigate(data.steps[1].path);
83+
navigate( data.steps[ 1 ].path );
8384
};
8485

8586
const handleMigration = () => {
86-
if (canMigrateSite) {
87+
if ( canMigrateSite ) {
8788
const migrationStepExists = allSteps.some(
88-
(step) => step.path === stepSiteGenMigration.path
89+
( step ) => step.path === stepSiteGenMigration.path
8990
);
9091

91-
if (!migrationStepExists) {
92-
const updates = injectMigrationStep(allSteps, stepTheFork);
93-
updateAllSteps(updates.allSteps);
92+
if ( ! migrationStepExists ) {
93+
const updates = injectMigrationStep( allSteps, stepTheFork );
94+
updateAllSteps( updates.allSteps );
9495
}
9596

96-
navigate(stepSiteGenMigration.path);
97+
navigate( stepSiteGenMigration.path );
9798
} else {
98-
window.open(migrationUrl, '_blank');
99+
window.open( migrationUrl, '_blank' );
99100
}
100101
};
101102

102-
const selectFlow = (flow) => {
103+
const selectFlow = ( flow ) => {
103104
let flowForEvent = false;
104-
switch (flow) {
105+
switch ( flow ) {
105106
case 'sitebuild':
106107
flowForEvent = 'DIY';
107-
switchFlow(oldFlow);
108+
switchFlow( oldFlow );
108109
break;
109110
case 'sitegen':
110111
flowForEvent = 'AI';
111-
switchFlow(SITEGEN_FLOW);
112+
switchFlow( SITEGEN_FLOW );
112113
break;
113114
case 'hirepro':
114115
flowForEvent = 'PRO';
115-
window.open(hireProUrl, '_blank');
116+
window.open( hireProUrl, '_blank' );
116117
break;
117118
case 'migration':
118119
flowForEvent = 'MIGRATE';
@@ -125,11 +126,11 @@ const StartOptions = ({
125126
'TUTORIAL'
126127
)
127128
);
128-
window.location.replace(pluginDashboardPage);
129+
window.location.replace( pluginDashboardPage );
129130
return;
130131
}
131132

132-
if (flowForEvent) {
133+
if ( flowForEvent ) {
133134
trackOnboardingEvent(
134135
new OnboardingEvent(
135136
ACTION_SITEGEN_FORK_OPTION_SELECTED,
@@ -141,75 +142,75 @@ const StartOptions = ({
141142
return (
142143
<>
143144
<p className="nfd-onboarding-sitegen-options__questionnaire">
144-
{questionnaire}
145+
{ questionnaire }
145146
</p>
146147
<div
147148
className="nfd-onboarding-sitegen-options__option nfd-onboarding-sitegen-options__option--large"
148149
role="button"
149-
tabIndex={0}
150-
onClick={() => {
151-
selectFlow(largeOption.flow);
152-
}}
153-
onKeyDown={() => {
150+
tabIndex={ 0 }
151+
onClick={ () => {
152+
selectFlow( largeOption.flow );
153+
} }
154+
onKeyDown={ () => {
154155
{
155-
selectFlow(largeOption.flow);
156+
selectFlow( largeOption.flow );
156157
}
157-
}}
158-
data-flow={largeOption.flow}
158+
} }
159+
data-flow={ largeOption.flow }
159160
>
160161
<h3 className="nfd-onboarding-sitegen-options__option__heading__title nfd-onboarding-sitegen-options__option__heading__title--large">
161-
<OrbAnimation height={`80px`} />
162-
{largeOption.span && (
162+
<OrbAnimation height={ `80px` } />
163+
{ largeOption.span && (
163164
<span className="nfd-onboarding-sitegen-options__option__span">
164-
{largeOption.span}
165+
{ largeOption.span }
165166
</span>
166-
)}
167-
{largeOption.title}
167+
) }
168+
{ largeOption.title }
168169
</h3>
169170
<p className="nfd-onboarding-sitegen-options__option__heading__subtitle nfd-onboarding-sitegen-options__option__heading__subtitle--large">
170-
{largeOption.text1}
171+
{ largeOption.text1 }
171172
</p>
172173
<p className="nfd-onboarding-sitegen-options__option__heading__subtitle nfd-onboarding-sitegen-options__option__heading__subtitle--large">
173-
{largeOption.text2}
174+
{ largeOption.text2 }
174175
</p>
175176
</div>
176177
<div className="nfd-onboarding-sitegen-options__container">
177-
{smallOptions.map((tab, idx) => {
178+
{ smallOptions.map( ( tab, idx ) => {
178179
return tab.show ? (
179180
<div
180181
className="nfd-onboarding-sitegen-options__option"
181-
key={idx}
182+
key={ idx }
182183
role="button"
183-
tabIndex={0}
184-
onClick={() => {
185-
selectFlow(tab.flow);
186-
}}
187-
onKeyDown={() => {
184+
tabIndex={ 0 }
185+
onClick={ () => {
186+
selectFlow( tab.flow );
187+
} }
188+
onKeyDown={ () => {
188189
{
189-
selectFlow(tab.flow);
190+
selectFlow( tab.flow );
190191
}
191-
}}
192-
data-flow={tab.flow}
192+
} }
193+
data-flow={ tab.flow }
193194
>
194195
<h3 className="nfd-onboarding-sitegen-options__option__heading__title">
195-
{tab.span && (
196+
{ tab.span && (
196197
<span className="nfd-onboarding-sitegen-options__option__span">
197-
{tab.span}
198+
{ tab.span }
198199
</span>
199-
)}
200-
{tab.title}
200+
) }
201+
{ tab.title }
201202
</h3>
202203
<p className="nfd-onboarding-sitegen-options__option__heading__subtitle">
203-
{tab.subtitle}
204+
{ tab.subtitle }
204205
</p>
205206
</div>
206207
) : (
207208
<></>
208209
);
209-
})}
210+
} ) }
210211
</div>
211212
</>
212213
);
213214
};
214215

215-
export default memo(StartOptions);
216+
export default memo( StartOptions );

src/OnboardingSPA/steps/TheFork/contents.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
import { __ } from '@wordpress/i18n';
22

3-
const getContents = (canMigrateSite, migrationUrl) => {
3+
const getContents = ( canMigrateSite, migrationUrl ) => {
44
return {
5-
heading: __('Welcome to WordPress', 'wp-module-onboarding'),
6-
subheading: __('powered by ', 'wp-module-onboarding'),
5+
heading: __( 'Welcome to WordPress', 'wp-module-onboarding' ),
6+
subheading: __( 'powered by ', 'wp-module-onboarding' ),
77
questionnaire: __(
88
'Where would you like to start?',
99
'wp-module-onboarding'
1010
),
1111
largerOption: {
12-
title: __('Site Creator', 'wp-module-onboarding'),
13-
text1: __('Get a site created in seconds!', 'wp-module-onboarding'),
12+
title: __( 'Site Creator', 'wp-module-onboarding' ),
13+
text1: __(
14+
'Get a site created in seconds!',
15+
'wp-module-onboarding'
16+
),
1417
text2: __(
1518
'Content & design generated by AI, customizable by you.',
1619
'wp-module-onboarding'
1720
),
18-
span: __('AI', 'wp-module-onboarding'),
21+
span: __( 'AI', 'wp-module-onboarding' ),
1922
flow: 'sitegen',
2023
},
2124
smallerOptions: [
@@ -29,7 +32,7 @@ const getContents = (canMigrateSite, migrationUrl) => {
2932
// show: true,
3033
// },
3134
{
32-
title: __('Import a WordPress Site', 'wp-module-onboarding'),
35+
title: __( 'Import a WordPress Site', 'wp-module-onboarding' ),
3336
subtitle: __(
3437
'Use our free, automated import tool!',
3538
'wp-module-onboarding'
@@ -38,7 +41,7 @@ const getContents = (canMigrateSite, migrationUrl) => {
3841
show: canMigrateSite || migrationUrl,
3942
},
4043
{
41-
title: __('I’m following a tutorial', 'wp-module-onboarding'),
44+
title: __( 'I’m following a tutorial', 'wp-module-onboarding' ),
4245
subtitle: __(
4346
'Take me to the WP Admin Dashboard',
4447
'wp-module-onboarding'

src/OnboardingSPA/steps/TheFork/index.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ import { DEFAULT_FLOW } from '../../data/flows/constants';
1818

1919
const TheFork = () => {
2020
const { migrationUrl, canMigrateSite, pluginInstallHash } = useSelect(
21-
(select) => {
21+
( select ) => {
2222
return {
23-
migrationUrl: select(nfdOnboardingStore).getMigrationUrl(),
24-
canMigrateSite: select(nfdOnboardingStore).canMigrateSite(),
25-
currentStep: select(nfdOnboardingStore).getCurrentStep(),
26-
routes: select(nfdOnboardingStore).getRoutes(),
23+
migrationUrl: select( nfdOnboardingStore ).getMigrationUrl(),
24+
canMigrateSite: select( nfdOnboardingStore ).canMigrateSite(),
25+
currentStep: select( nfdOnboardingStore ).getCurrentStep(),
26+
routes: select( nfdOnboardingStore ).getRoutes(),
2727
pluginInstallHash:
28-
select(nfdOnboardingStore).getPluginInstallHash(),
28+
select( nfdOnboardingStore ).getPluginInstallHash(),
2929
};
3030
}
3131
);
@@ -37,18 +37,18 @@ const TheFork = () => {
3737
setIsHeaderNavigationEnabled,
3838
setFooterActiveView,
3939
setHideFooterNav,
40-
} = useDispatch(nfdOnboardingStore);
40+
} = useDispatch( nfdOnboardingStore );
4141

42-
useEffect(() => {
43-
setHideFooterNav(true);
44-
setIsHeaderEnabled(false);
45-
setSidebarActiveView(false);
46-
setIsHeaderNavigationEnabled(false);
47-
setHeaderActiveView(HEADER_SITEGEN);
48-
setDrawerActiveView(false);
49-
setFooterActiveView(FOOTER_SITEGEN);
50-
initializePlugins(pluginInstallHash);
51-
});
42+
useEffect( () => {
43+
setHideFooterNav( true );
44+
setIsHeaderEnabled( false );
45+
setSidebarActiveView( false );
46+
setIsHeaderNavigationEnabled( false );
47+
setHeaderActiveView( HEADER_SITEGEN );
48+
setDrawerActiveView( false );
49+
setFooterActiveView( FOOTER_SITEGEN );
50+
initializePlugins( pluginInstallHash );
51+
} );
5252

5353
const oldFlow = window.nfdOnboarding?.oldFlow
5454
? window.nfdOnboarding.oldFlow
@@ -65,32 +65,32 @@ const TheFork = () => {
6565
// window.location.replace( pluginDashboardPage );
6666
// };
6767

68-
const content = getContents(canMigrateSite, migrationUrl);
68+
const content = getContents( canMigrateSite, migrationUrl );
6969

7070
return (
7171
<CommonLayout
7272
isCentered
7373
className="nfd-onboarding-step--site-gen__fork"
7474
>
7575
<HeadingWithSubHeading
76-
title={content.heading}
77-
subtitle={content.subheading}
76+
title={ content.heading }
77+
subtitle={ content.subheading }
7878
/>
7979
<StartOptions
80-
questionnaire={content.questionnaire}
81-
oldFlow={oldFlow}
82-
largeOption={content.largerOption}
83-
smallOptions={content.smallerOptions}
80+
questionnaire={ content.questionnaire }
81+
oldFlow={ oldFlow }
82+
largeOption={ content.largerOption }
83+
smallOptions={ content.smallerOptions }
8484
/>
85-
{/* <span
85+
{ /* <span
8686
role="button"
8787
tabIndex={ 0 }
8888
className="nfd-onboarding-step--site-gen__fork__exit"
8989
onClick={ () => handleForkExit() }
9090
onKeyDown={ () => handleForkExit() }
9191
>
9292
{ content.exitToWordPress }
93-
</span> */}
93+
</span> */ }
9494
</CommonLayout>
9595
);
9696
};

0 commit comments

Comments
 (0)