Skip to content

Commit 62a847f

Browse files
dsasclaude
andcommitted
Site Editor: Return empty fragment from mobile areas while theme data loads
When areas.mobile is falsy, the layout briefly renders the desktop sidebar instead of the mobile layout. Return an empty fragment rather than null so the mobile layout container stays mounted during loading. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6ca6b36 commit 62a847f

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

‎packages/edit-site/src/components/site-editor-routes/home.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const homeRoute = {
3030
},
3131
mobile( { siteData } ) {
3232
if ( ! isThemeDataLoaded( siteData ) ) {
33-
return null;
33+
return <></>;
3434
}
3535
return siteData.currentTheme.is_block_theme ||
3636
isClassicThemeWithStyleBookSupport( siteData ) ? (

‎packages/edit-site/src/components/site-editor-routes/navigation-item.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const navigationItemRoute = {
5151
},
5252
mobile( { siteData } ) {
5353
if ( ! isThemeDataLoaded( siteData ) ) {
54-
return null;
54+
return <></>;
5555
}
5656
return siteData.currentTheme.is_block_theme ? (
5757
<MobileNavigationItemView />

‎packages/edit-site/src/components/site-editor-routes/navigation.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const navigationRoute = {
4545
},
4646
mobile( { siteData } ) {
4747
if ( ! isThemeDataLoaded( siteData ) ) {
48-
return null;
48+
return <></>;
4949
}
5050
return siteData.currentTheme.is_block_theme ? (
5151
<MobileNavigationView />

‎packages/edit-site/src/components/site-editor-routes/page-item.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const pageItemRoute = {
3232
},
3333
mobile( { siteData } ) {
3434
if ( ! isThemeDataLoaded( siteData ) ) {
35-
return null;
35+
return <></>;
3636
}
3737
return siteData.currentTheme.is_block_theme ? (
3838
<Editor />

‎packages/edit-site/src/components/site-editor-routes/pages.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const pagesRoute = {
7979
},
8080
mobile( { siteData } ) {
8181
if ( ! isThemeDataLoaded( siteData ) ) {
82-
return null;
82+
return <></>;
8383
}
8484
return siteData.currentTheme.is_block_theme ? (
8585
<MobilePagesView />

‎packages/edit-site/src/components/site-editor-routes/template-item.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const areas = {
1919
},
2020
mobile( { siteData } ) {
2121
if ( ! isThemeDataLoaded( siteData ) ) {
22-
return null;
22+
return <></>;
2323
}
2424
return siteData.currentTheme.is_block_theme ? (
2525
<Editor />

‎packages/edit-site/src/components/site-editor-routes/templates.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const templatesRoute = {
7272
},
7373
mobile( { siteData } ) {
7474
if ( ! isThemeDataLoaded( siteData ) ) {
75-
return null;
75+
return <></>;
7676
}
7777
if ( ! siteData.currentTheme.is_block_theme ) {
7878
return <SidebarNavigationScreenUnsupported />;

0 commit comments

Comments
 (0)