diff --git a/packages/block-editor/src/components/inserter/style.scss b/packages/block-editor/src/components/inserter/style.scss index 22588e5c3a7b48..ad5a2d6642b4a2 100644 --- a/packages/block-editor/src/components/inserter/style.scss +++ b/packages/block-editor/src/components/inserter/style.scss @@ -125,6 +125,12 @@ $block-inserter-tabs-height: 44px; .components-tab-panel__tabs-item { flex-grow: 1; margin-bottom: -$border-width; + &[id$="reusable"] { + flex-grow: inherit; + // These are to align the `reusable` icon with the search icon. + padding-left: $grid-unit-20; + padding-right: $grid-unit-20; + } } } diff --git a/packages/block-editor/src/components/inserter/tabs.js b/packages/block-editor/src/components/inserter/tabs.js index afc1c74e0a280d..24bfade8b2f4be 100644 --- a/packages/block-editor/src/components/inserter/tabs.js +++ b/packages/block-editor/src/components/inserter/tabs.js @@ -1,6 +1,7 @@ /** * WordPress dependencies */ +import { symbol as reusableBlockIcon } from '@wordpress/icons'; import { useMemo } from '@wordpress/element'; import { TabPanel } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; @@ -19,6 +20,7 @@ const reusableBlocksTab = { name: 'reusable', /* translators: Reusable blocks tab title in the block inserter. */ title: __( 'Reusable' ), + icon: reusableBlockIcon, }; function InserterTabs( { diff --git a/packages/components/src/search-control/style.scss b/packages/components/src/search-control/style.scss index ddd9d0e5b06e3b..c02250de4f52ee 100644 --- a/packages/components/src/search-control/style.scss +++ b/packages/components/src/search-control/style.scss @@ -10,6 +10,10 @@ width: 100%; height: $grid-unit-60; + // Unset inherited values. + margin-left: 0; + margin-right: 0; + /* Fonts smaller than 16px causes mobile safari to zoom. */ font-size: $mobile-text-min-font-size; @include break-small { diff --git a/packages/e2e-test-utils/src/inserter.js b/packages/e2e-test-utils/src/inserter.js index ba11908fc4fa39..58e86cd0cf8f7e 100644 --- a/packages/e2e-test-utils/src/inserter.js +++ b/packages/e2e-test-utils/src/inserter.js @@ -142,12 +142,12 @@ export async function searchForReusableBlock( searchTerm ) { // fetched. They aren't fetched until an inserter is used or the post // already contains reusable blocks, so wait for the tab to appear. await page.waitForXPath( - '//div[contains(@class, "block-editor-inserter__tabs")]//button[text()="Reusable"]' + '//div[contains(@class, "block-editor-inserter__tabs")]//button[@aria-label="Reusable"]' ); // Select the reusable blocks tab. const tab = await page.waitForXPath( - '//div[contains(@class, "block-editor-inserter__tabs")]//button[text()="Reusable"]' + '//div[contains(@class, "block-editor-inserter__tabs")]//button[@aria-label="Reusable"]' ); await tab.click(); await page.waitForSelector( INSERTER_SEARCH_SELECTOR );