Skip to content

Commit 97e023a

Browse files
committed
Fix Lint
1 parent 4b436d1 commit 97e023a

File tree

3 files changed

+123
-118
lines changed

3 files changed

+123
-118
lines changed

src/OnboardingSPA/components/StartOptions/index.js

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

26-
const StartOptions = ( { questionnaire, oldFlow, largeOption, smallOptions } ) => {
26+
const StartOptions = ({
27+
questionnaire,
28+
oldFlow,
29+
largeOption,
30+
smallOptions,
31+
}) => {
2732
const navigate = useNavigate();
28-
const { brandConfig, hireProUrl, currentData, migrationUrl, canMigrateSite, allSteps } = useSelect( ( select ) => {
33+
const {
34+
brandConfig,
35+
hireProUrl,
36+
currentData,
37+
migrationUrl,
38+
canMigrateSite,
39+
allSteps,
40+
} = useSelect((select) => {
2941
return {
30-
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(),
42+
brandConfig: select(nfdOnboardingStore).getNewfoldBrandConfig(),
3143
hireProUrl:
32-
select( nfdOnboardingStore ).getfullServiceCreativeTeamUrl(),
33-
currentData:
34-
select( nfdOnboardingStore ).getCurrentOnboardingData(),
35-
allSteps: select( nfdOnboardingStore ).getAllSteps(),
36-
canMigrateSite: select( nfdOnboardingStore ).canMigrateSite(),
37-
migrationUrl: select( nfdOnboardingStore ).getMigrationUrl(),
44+
select(nfdOnboardingStore).getfullServiceCreativeTeamUrl(),
45+
currentData: select(nfdOnboardingStore).getCurrentOnboardingData(),
46+
allSteps: select(nfdOnboardingStore).getAllSteps(),
47+
canMigrateSite: select(nfdOnboardingStore).canMigrateSite(),
48+
migrationUrl: select(nfdOnboardingStore).getMigrationUrl(),
3849
};
39-
} );
50+
});
4051
const {
4152
updateAllSteps,
4253
updateTopSteps,
4354
updateRoutes,
4455
updateDesignRoutes,
4556
updateInitialize,
4657
setCurrentOnboardingData,
47-
} = useDispatch( nfdOnboardingStore );
58+
} = useDispatch(nfdOnboardingStore);
4859

49-
const switchFlow = ( newFlow ) => {
50-
if ( ! validateFlow( brandConfig, newFlow ) ) {
60+
const switchFlow = (newFlow) => {
61+
if (!validateFlow(brandConfig, newFlow)) {
5162
return false;
5263
}
5364
const currentFlow = window.nfdOnboarding.currentFlow;
54-
const getData = resolveGetDataForFlow( newFlow );
65+
const getData = resolveGetDataForFlow(newFlow);
5566
const data = getData();
56-
updateAllSteps( data.steps );
57-
updateTopSteps( data?.topSteps );
58-
updateRoutes( data.routes );
59-
updateDesignRoutes( data?.designRoutes );
60-
if ( SITEGEN_FLOW !== currentFlow ) {
67+
updateAllSteps(data.steps);
68+
updateTopSteps(data?.topSteps);
69+
updateRoutes(data.routes);
70+
updateDesignRoutes(data?.designRoutes);
71+
if (SITEGEN_FLOW !== currentFlow) {
6172
window.nfdOnboarding.oldFlow = currentFlow;
6273
}
6374

6475
window.nfdOnboarding.currentFlow = newFlow;
6576
currentData.activeFlow = newFlow;
6677
currentData.continueWithoutAi = false;
67-
setCurrentOnboardingData( currentData );
68-
if ( SITEGEN_FLOW !== newFlow ) {
69-
updateInitialize( true );
78+
setCurrentOnboardingData(currentData);
79+
if (SITEGEN_FLOW !== newFlow) {
80+
updateInitialize(true);
7081
}
71-
navigate( data.steps[ 1 ].path );
82+
navigate(data.steps[1].path);
7283
};
7384

7485
const handleMigration = () => {
75-
if ( canMigrateSite ) {
86+
if (canMigrateSite) {
7687
const migrationStepExists = allSteps.some(
77-
( step ) => step.path === stepSiteGenMigration.path
88+
(step) => step.path === stepSiteGenMigration.path
7889
);
7990

80-
if ( ! migrationStepExists ) {
81-
const updates = injectMigrationStep( allSteps, stepTheFork );
82-
updateAllSteps( updates.allSteps );
91+
if (!migrationStepExists) {
92+
const updates = injectMigrationStep(allSteps, stepTheFork);
93+
updateAllSteps(updates.allSteps);
8394
}
8495

85-
navigate( stepSiteGenMigration.path );
96+
navigate(stepSiteGenMigration.path);
8697
} else {
87-
window.open( migrationUrl, '_blank' );
98+
window.open(migrationUrl, '_blank');
8899
}
89100
};
90101

91-
const selectFlow = ( flow ) => {
102+
const selectFlow = (flow) => {
92103
let flowForEvent = false;
93-
switch ( flow ) {
104+
switch (flow) {
94105
case 'sitebuild':
95106
flowForEvent = 'DIY';
96-
switchFlow( oldFlow );
107+
switchFlow(oldFlow);
97108
break;
98109
case 'sitegen':
99110
flowForEvent = 'AI';
100-
switchFlow( SITEGEN_FLOW );
111+
switchFlow(SITEGEN_FLOW);
101112
break;
102113
case 'hirepro':
103114
flowForEvent = 'PRO';
104-
window.open( hireProUrl, '_blank' );
115+
window.open(hireProUrl, '_blank');
105116
break;
106117
case 'migration':
107118
flowForEvent = 'MIGRATE';
@@ -114,11 +125,11 @@ const StartOptions = ( { questionnaire, oldFlow, largeOption, smallOptions } ) =
114125
'TUTORIAL'
115126
)
116127
);
117-
window.location.replace( pluginDashboardPage );
128+
window.location.replace(pluginDashboardPage);
118129
return;
119130
}
120131

121-
if ( flowForEvent ) {
132+
if (flowForEvent) {
122133
trackOnboardingEvent(
123134
new OnboardingEvent(
124135
ACTION_SITEGEN_FORK_OPTION_SELECTED,
@@ -130,73 +141,75 @@ const StartOptions = ( { questionnaire, oldFlow, largeOption, smallOptions } ) =
130141
return (
131142
<>
132143
<p className="nfd-onboarding-sitegen-options__questionnaire">
133-
{ questionnaire }
144+
{questionnaire}
134145
</p>
135-
<div className="nfd-onboarding-sitegen-options__option nfd-onboarding-sitegen-options__option--large"
146+
<div
147+
className="nfd-onboarding-sitegen-options__option nfd-onboarding-sitegen-options__option--large"
136148
role="button"
137-
tabIndex={ 0 }
138-
onClick={ () => {
139-
selectFlow( largeOption.flow );
140-
} }
141-
onKeyDown={ () => {
149+
tabIndex={0}
150+
onClick={() => {
151+
selectFlow(largeOption.flow);
152+
}}
153+
onKeyDown={() => {
142154
{
143-
selectFlow( largeOption.flow );
155+
selectFlow(largeOption.flow);
144156
}
145-
} }
146-
data-flow={ largeOption.flow }>
157+
}}
158+
data-flow={largeOption.flow}
159+
>
147160
<h3 className="nfd-onboarding-sitegen-options__option__heading__title nfd-onboarding-sitegen-options__option__heading__title--large">
148-
<OrbAnimation height={ `80px` } />
149-
{ largeOption.span && (
161+
<OrbAnimation height={`80px`} />
162+
{largeOption.span && (
150163
<span className="nfd-onboarding-sitegen-options__option__span">
151-
{ largeOption.span }
164+
{largeOption.span}
152165
</span>
153-
) }
154-
{ largeOption.title }
166+
)}
167+
{largeOption.title}
155168
</h3>
156169
<p className="nfd-onboarding-sitegen-options__option__heading__subtitle nfd-onboarding-sitegen-options__option__heading__subtitle--large">
157-
{ largeOption.text1 }
170+
{largeOption.text1}
158171
</p>
159172
<p className="nfd-onboarding-sitegen-options__option__heading__subtitle nfd-onboarding-sitegen-options__option__heading__subtitle--large">
160-
{ largeOption.text2 }
173+
{largeOption.text2}
161174
</p>
162-
163175
</div>
164176
<div className="nfd-onboarding-sitegen-options__container">
165-
166-
{ smallOptions.map( ( tab, idx ) => {
177+
{smallOptions.map((tab, idx) => {
167178
return tab.show ? (
168179
<div
169180
className="nfd-onboarding-sitegen-options__option"
170-
key={ idx }
181+
key={idx}
171182
role="button"
172-
tabIndex={ 0 }
173-
onClick={ () => {
174-
selectFlow( tab.flow );
175-
} }
176-
onKeyDown={ () => {
183+
tabIndex={0}
184+
onClick={() => {
185+
selectFlow(tab.flow);
186+
}}
187+
onKeyDown={() => {
177188
{
178-
selectFlow( tab.flow );
189+
selectFlow(tab.flow);
179190
}
180-
} }
181-
data-flow={ tab.flow }
191+
}}
192+
data-flow={tab.flow}
182193
>
183194
<h3 className="nfd-onboarding-sitegen-options__option__heading__title">
184-
{ tab.span && (
195+
{tab.span && (
185196
<span className="nfd-onboarding-sitegen-options__option__span">
186-
{ tab.span }
197+
{tab.span}
187198
</span>
188-
) }
189-
{ tab.title }
199+
)}
200+
{tab.title}
190201
</h3>
191202
<p className="nfd-onboarding-sitegen-options__option__heading__subtitle">
192-
{ tab.subtitle }
203+
{tab.subtitle}
193204
</p>
194205
</div>
195-
) : <></>;
196-
} ) }
206+
) : (
207+
<></>
208+
);
209+
})}
197210
</div>
198211
</>
199212
);
200213
};
201214

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

src/OnboardingSPA/steps/TheFork/contents.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
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: __('Get a site created in seconds!', 'wp-module-onboarding'),
1414
text2: __(
1515
'Content & design generated by AI, customizable by you.',
1616
'wp-module-onboarding'
1717
),
18-
span: __( 'AI', 'wp-module-onboarding' ),
18+
span: __('AI', 'wp-module-onboarding'),
1919
flow: 'sitegen',
2020
},
2121
smallerOptions: [
@@ -29,7 +29,7 @@ const getContents = ( canMigrateSite, migrationUrl ) => {
2929
// show: true,
3030
// },
3131
{
32-
title: __( 'Import a WordPress Site', 'wp-module-onboarding' ),
32+
title: __('Import a WordPress Site', 'wp-module-onboarding'),
3333
subtitle: __(
3434
'Use our free, automated import tool!',
3535
'wp-module-onboarding'
@@ -38,7 +38,7 @@ const getContents = ( canMigrateSite, migrationUrl ) => {
3838
show: canMigrateSite || migrationUrl,
3939
},
4040
{
41-
title: __( 'I’m following a tutorial', 'wp-module-onboarding' ),
41+
title: __('I’m following a tutorial', 'wp-module-onboarding'),
4242
subtitle: __(
4343
'Take me to the WP Admin Dashboard',
4444
'wp-module-onboarding'

0 commit comments

Comments
 (0)