-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit Widgets: use list view sidebar instead of dropdown
- Loading branch information
Showing
16 changed files
with
286 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 0 additions & 78 deletions
78
packages/block-editor/src/components/block-navigation/dropdown.js
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
packages/block-editor/src/components/block-navigation/style.scss
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/edit-widgets/src/components/secondary-sidebar/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { useSelect } from '@wordpress/data'; | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { store as editWidgetsStore } from '../../store'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import InserterSidebar from './inserter-sidebar'; | ||
import ListViewSidebar from './list-view-sidebar'; | ||
|
||
export default function SecondarySidebar() { | ||
const { isInserterOpen, isListViewOpen } = useSelect( ( select ) => { | ||
const { isInserterOpened, isListViewOpened } = select( | ||
editWidgetsStore | ||
); | ||
return { | ||
isInserterOpen: isInserterOpened(), | ||
isListViewOpen: isListViewOpened(), | ||
}; | ||
}, [] ); | ||
|
||
if ( isInserterOpen ) { | ||
return <InserterSidebar />; | ||
} | ||
if ( isListViewOpen ) { | ||
return <ListViewSidebar />; | ||
} | ||
return null; | ||
} |
Oops, something went wrong.