Fix flash of unstyled content for onboarding pages (https://github.com/woocommerce/woocommerce-admin/pull/2673)
This commit is contained in:
parent
63c5285084
commit
f1f3a6e20d
|
@ -74,13 +74,13 @@ class ProfileWizard extends Component {
|
|||
componentDidMount() {
|
||||
document.documentElement.classList.remove( 'wp-toolbar' );
|
||||
document.body.classList.add( 'woocommerce-profile-wizard__body' );
|
||||
document.body.classList.add( 'woocommerce-dashboard__body' );
|
||||
document.body.classList.add( 'woocommerce-admin-full-screen' );
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.documentElement.classList.add( 'wp-toolbar' );
|
||||
document.body.classList.remove( 'woocommerce-profile-wizard__body' );
|
||||
document.body.classList.remove( 'woocommerce-dashboard__body' );
|
||||
document.body.classList.remove( 'woocommerce-admin-full-screen' );
|
||||
}
|
||||
|
||||
getCurrentStep() {
|
||||
|
|
|
@ -74,30 +74,3 @@
|
|||
padding-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.woocommerce-dashboard__body {
|
||||
background: $muriel-gray-0;
|
||||
color: $muriel-gray-600;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell,
|
||||
'Helvetica Neue', sans-serif;
|
||||
|
||||
#wpbody-content {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* Hide wp-admin and WooCommerce elements when the dashboard body class is present */
|
||||
#adminmenumain,
|
||||
.woocommerce-layout__header,
|
||||
.update-nag,
|
||||
.woocommerce-store-alerts,
|
||||
.woocommerce-message,
|
||||
.notice,
|
||||
.error,
|
||||
.updated {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#wpcontent {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,3 +26,45 @@
|
|||
.woocommerce-page .update-nag {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.woocommerce-admin-is-loading {
|
||||
#adminmenumain,
|
||||
#wpfooter,
|
||||
#wpadminbar,
|
||||
.woocommerce-layout__header,
|
||||
.update-nag,
|
||||
.woocommerce-store-alerts,
|
||||
.woocommerce-message,
|
||||
.notice,
|
||||
.error,
|
||||
.updated {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.woocommerce-admin-full-screen {
|
||||
background: $muriel-gray-0;
|
||||
color: $muriel-gray-600;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell,
|
||||
'Helvetica Neue', sans-serif;
|
||||
|
||||
#wpbody-content {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* Hide wp-admin and WooCommerce elements when the dashboard body class is present */
|
||||
#adminmenumain,
|
||||
.woocommerce-layout__header,
|
||||
.update-nag,
|
||||
.woocommerce-store-alerts,
|
||||
.woocommerce-message,
|
||||
.notice,
|
||||
.error,
|
||||
.updated {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#wpcontent {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -320,7 +320,9 @@ class WC_Admin_Onboarding {
|
|||
*/
|
||||
public function is_loading( $is_loading ) {
|
||||
$show_profiler = $this->should_show_profiler();
|
||||
if ( ! $show_profiler ) {
|
||||
$is_dashboard = ! isset( $_GET['path'] ); // WPCS: csrf ok.
|
||||
|
||||
if ( ! $show_profiler || ! $is_dashboard ) {
|
||||
return $is_loading;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue