Skip to content

Commit

Permalink
Remove the loader from sidebar navigation screen. (#50326)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfra authored May 11, 2023
1 parent 1664d5e commit ed9be12
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
*/
import SidebarNavigationScreen from '../sidebar-navigation-screen';
import NavigationMenuContent from './navigation-menu-content';
import { NavigationMenuLoader } from './loader';
import { unlock } from '../../private-apis';
import { store as editSiteStore } from '../../store';
import {
Expand Down Expand Up @@ -75,7 +74,6 @@ export default function SidebarNavigationScreenNavigationMenus() {
];
}, [ firstNavigationMenu ] );

const isLoading = ! hasResolvedNavigationMenus;
const hasNavigationMenus = !! navigationMenus?.length;

const onSelect = useCallback(
Expand Down Expand Up @@ -116,14 +114,6 @@ export default function SidebarNavigationScreenNavigationMenus() {
);
}

if ( ! hasResolvedNavigationMenus || isLoading ) {
return (
<SidebarNavigationScreenWrapper>
<NavigationMenuLoader />
</SidebarNavigationScreenWrapper>
);
}

return (
<BlockEditorProvider
settings={ storedSettings }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { store as coreStore } from '@wordpress/core-data';
* Internal dependencies
*/
import { unlock } from '../../private-apis';
import { NavigationMenuLoader } from './loader';

function CustomLinkAdditionalBlockUI( { block, onClose } ) {
const { updateBlockAttributes } = useDispatch( blockEditorStore );
Expand Down Expand Up @@ -179,7 +178,6 @@ export default function NavigationMenuContent( { rootClientId, onSelect } ) {
// For example a navigation page list load its items has an effect on edit to load its items.
return (
<>
{ isLoading && <NavigationMenuLoader /> }
{ ! isLoading && (
<PrivateListView
blocks={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,6 @@
margin: 0 0 $grid-unit-40 $grid-unit-20;
}

.edit-site-sidebar-navigation-screen-navigation-menus__placeholder {
padding: $grid-unit-10;
margin: $grid-unit-10;
background-color: $gray-100;
animation: loadingpulse 1s linear infinite;
animation-delay: 0.5s; // avoid animating for fast network responses
}

@keyframes loadingpulse {
0% {
opacity: 1;
}
50% {
opacity: 0.5;
}
100% {
opacity: 1;
}
}

.edit-site-sidebar-navigation-screen-navigation-menus__content {
.offcanvas-editor-list-view-leaf {
max-width: calc(100% - #{ $grid-unit-05 });
Expand Down

1 comment on commit ed9be12

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in ed9be12.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4944474031
📝 Reported issues:

Please sign in to comment.