Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Inserter]: Replace text in Reusable tab with an icon
  • Loading branch information
ntsekouras committed Nov 17, 2022
commit e9d1f19bb27345ac425f3941c03b5d0fc53054b5
3 changes: 3 additions & 0 deletions packages/block-editor/src/components/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ $block-inserter-tabs-height: 44px;
.components-tab-panel__tabs-item {
flex-grow: 1;
margin-bottom: -$border-width;
&[id$="reusable"] {
flex-grow: inherit;
}
}
}

Expand Down
9 changes: 7 additions & 2 deletions packages/block-editor/src/components/inserter/tabs.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
/**
* WordPress dependencies
*/
import { symbol as reusableBlockIcon } from '@wordpress/icons';
import { useMemo } from '@wordpress/element';
import { TabPanel } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import BlockIcon from '../block-icon';

const blocksTab = {
name: 'blocks',
/* translators: Blocks tab title in the block inserter. */
Expand All @@ -17,8 +23,7 @@ const patternsTab = {
};
const reusableBlocksTab = {
name: 'reusable',
/* translators: Reusable blocks tab title in the block inserter. */
title: __( 'Reusable' ),
title: <BlockIcon icon={ reusableBlockIcon } />,
};

function InserterTabs( {
Expand Down