Skip to content

Commit

Permalink
pass props to Tabs directly
Browse files Browse the repository at this point in the history
  • Loading branch information
chad1008 committed Nov 9, 2023
1 parent 183c3b9 commit 6b72d41
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions packages/edit-post/src/components/sidebar/settings-header/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
* WordPress dependencies
*/
import {
Button,
privateApis as componentsPrivateApis,
} from '@wordpress/components';
import { privateApis as componentsPrivateApis } from '@wordpress/components';
import { __, _x, sprintf } from '@wordpress/i18n';
import { useDispatch, useSelect } from '@wordpress/data';
import { store as editorStore } from '@wordpress/editor';
Expand Down Expand Up @@ -56,34 +53,22 @@ const SettingsHeader = ( { sidebarName } ) => {
<Tabs.TabList>
<Tabs.Tab
id={ 'edit-post/document' }
render={
isTemplateMode ? (
<Button
onClick={ openDocumentSettings }
aria-label={ templateAriaLabel }
data-label={ __( 'Template' ) }
/>
) : (
<Button
onClick={ openDocumentSettings }
aria-label={ documentAriaLabel }
data-label={ documentLabel }
/>
)
onClick={ openDocumentSettings }
aria-label={
isTemplateMode ? templateAriaLabel : documentAriaLabel
}
data-label={
isTemplateMode ? __( 'Template' ) : documentLabel
}
>
{ isTemplateMode ? __( 'Template' ) : documentLabel }
</Tabs.Tab>
<Tabs.Tab
id={ 'edit-post/block' }
render={
<Button
onClick={ openBlockSettings }
aria-label={ blockAriaLabel }
// translators: Data label for the Block Settings Sidebar tab.
data-label={ __( 'Block' ) }
/>
}
onClick={ openBlockSettings }
aria-label={ blockAriaLabel }
// translators: Data label for the Block Settings Sidebar tab.
data-label={ __( 'Block' ) }
>
{ /* translators: Text label for the Block Settings Sidebar tab. */ }
{ __( 'Block' ) }
Expand Down

0 comments on commit 6b72d41

Please sign in to comment.