-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
) * implement `Tabs` * update styles * focusable false * replace render function with object * fix inserter tests * pass contents as prop instead of children
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,17 +191,13 @@ function InserterMenu( | |
] | ||
); | ||
|
||
const getCurrentTab = useCallback( | ||
( tab ) => { | ||
if ( tab.name === 'blocks' ) { | ||
return blocksTab; | ||
} else if ( tab.name === 'patterns' ) { | ||
return patternsTab; | ||
} else if ( tab.name === 'media' ) { | ||
return mediaTab; | ||
} | ||
}, | ||
[ blocksTab, patternsTab, mediaTab ] | ||
const inserterTabsContents = useMemo( | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ciampo
Contributor
|
||
() => ( { | ||
blocks: blocksTab, | ||
patterns: patternsTab, | ||
media: mediaTab, | ||
} ), | ||
[ blocksTab, mediaTab, patternsTab ] | ||
); | ||
|
||
const searchRef = useRef(); | ||
|
@@ -275,9 +271,8 @@ function InserterMenu( | |
showMedia={ showMedia } | ||
prioritizePatterns={ prioritizePatterns } | ||
onSelect={ handleSetSelectedTab } | ||
> | ||
{ getCurrentTab } | ||
</InserterTabs> | ||
tabsContents={ inserterTabsContents } | ||
/> | ||
) } | ||
{ ! delayedFilterValue && ! showAsTabs && ( | ||
<div className="block-editor-inserter__no-tab-container"> | ||
|
1 comment
on commit 37401d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in 37401d5.
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/7199491432
📝 Reported issues:
- [Flaky Test] it should lock the root Navigation block in the editor #57017 in
/test/e2e/specs/site-editor/navigation-editor.spec.js
- [Flaky Test] should display the "Manage Fonts" icon #56776 in
/test/e2e/specs/site-editor/font-library.spec.js
Why is this memoized? Is InserterSearchResults a pure/memoized component based on its props?