1
- import path from 'path' ;
1
+ import { parse } from 'path' ;
2
2
import config from '@automattic/calypso-config' ;
3
3
import { isLocaleRtl } from '@automattic/i18n-utils' ;
4
4
import { Step } from '@automattic/onboarding' ;
@@ -18,7 +18,6 @@ import EnvironmentBadge, {
18
18
import Head from 'calypso/components/head' ;
19
19
import JetpackLogo from 'calypso/components/jetpack-logo' ;
20
20
import Loading from 'calypso/components/loading' ;
21
- import { LoadingEllipsis } from 'calypso/components/loading-ellipsis' ;
22
21
import WooCommerceLogo from 'calypso/components/woocommerce-logo' ;
23
22
import WordPressLogo from 'calypso/components/wordpress-logo' ;
24
23
import isA8CForAgencies from 'calypso/lib/a8c-for-agencies/is-a8c-for-agencies' ;
@@ -74,7 +73,7 @@ class Document extends Component {
74
73
75
74
const installedChunks = entrypoint . js
76
75
. concat ( chunkFiles . js )
77
- . map ( ( chunk ) => path . parse ( chunk ) . name ) ;
76
+ . map ( ( chunk ) => parse ( chunk ) . name ) ;
78
77
79
78
const inlineScript =
80
79
`var COMMIT_SHA = ${ jsonStringifyForHtml ( commitSha ) } ;\n` +
@@ -134,15 +133,6 @@ class Document extends Component {
134
133
}
135
134
}
136
135
137
- const shouldNotShowLoadingLogo =
138
- sectionName === 'checkout' || sectionName === 'stepper' || sectionName === 'signup' ;
139
-
140
- const LoadingLogo = chooseLoadingLogo ( this . props , {
141
- isWpMobileApp : app ?. isWpMobileApp ,
142
- isWcMobileApp : app ?. isWcMobileApp ,
143
- isWCCOM,
144
- } ) ;
145
-
146
136
return (
147
137
< html
148
138
lang = { lang }
@@ -197,17 +187,12 @@ class Document extends Component {
197
187
} ) }
198
188
>
199
189
< div className = "layout__content" >
200
- { shouldNotShowLoadingLogo ? (
201
- < >
202
- { showStepContainerV2Loader ? (
203
- < Step . Loading />
204
- ) : (
205
- < Loading className = "wpcom-loading__boot" />
206
- ) }
207
- </ >
208
- ) : (
209
- < LoadingLogo size = { 72 } className = "wpcom-site__logo" />
210
- ) }
190
+ < LoadingPlaceholder
191
+ app = { app }
192
+ sectionName = { sectionName }
193
+ isWCCOM = { isWCCOM }
194
+ showStepContainerV2Loader = { showStepContainerV2Loader }
195
+ />
211
196
</ div >
212
197
</ div >
213
198
</ div >
@@ -312,12 +297,27 @@ class Document extends Component {
312
297
) ;
313
298
}
314
299
}
300
+ function LoadingPlaceholder ( { app, sectionName, isWCCOM, showStepContainerV2Loader } ) {
301
+ const shouldNotShowLoadingLogo =
302
+ sectionName === 'checkout' || sectionName === 'stepper' || sectionName === 'signup' ;
315
303
316
- function chooseLoadingLogo ( { useLoadingEllipsis } , { isWpMobileApp, isWcMobileApp, isWCCOM } ) {
317
- if ( useLoadingEllipsis ) {
318
- return LoadingEllipsis ;
304
+ if ( shouldNotShowLoadingLogo ) {
305
+ return showStepContainerV2Loader ? (
306
+ < Step . Loading />
307
+ ) : (
308
+ < Loading className = "wpcom-loading__boot" />
309
+ ) ;
319
310
}
320
311
312
+ const LoadingLogo = chooseLoadingLogo ( {
313
+ isWpMobileApp : app ?. isWpMobileApp ,
314
+ isWcMobileApp : app ?. isWcMobileApp ,
315
+ isWCCOM,
316
+ } ) ;
317
+ return < LoadingLogo size = { 72 } className = "wpcom-site__logo" /> ;
318
+ }
319
+
320
+ function chooseLoadingLogo ( { isWpMobileApp, isWcMobileApp, isWCCOM } ) {
321
321
if ( isWcMobileApp || isWCCOM ) {
322
322
return WooCommerceLogo ;
323
323
}
0 commit comments