Skip to content

Commit

Permalink
incorporate initial feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
chad1008 committed Nov 3, 2023
1 parent c11a67f commit 6aa72d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
25 changes: 10 additions & 15 deletions packages/edit-post/src/components/sidebar/settings-header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ const SettingsHeader = ( { sidebarName } ) => {
};
}, [] );

const [ documentAriaLabel ] =
const documentAriaLabel =
sidebarName === 'edit-post/document'
? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.
[ sprintf( __( '%s (selected)' ), documentLabel ), 'is-active' ]
: [ documentLabel, '' ];
sprintf( __( '%s (selected)' ), documentLabel )
: documentLabel;

const [ blockAriaLabel ] =
const blockAriaLabel =
sidebarName === 'edit-post/block'
? // translators: ARIA label for the Block Settings Sidebar tab, selected.
[ __( 'Block (selected)' ), 'is-active' ]
__( 'Block (selected)' )
: // translators: ARIA label for the Block Settings Sidebar tab, not selected.
[ __( 'Block' ), '' ];
__( 'Block' );

const [ templateAriaLabel ] =
const templateAriaLabel =
sidebarName === 'edit-post/document'
? [ __( 'Template (selected)' ), 'is-active' ]
: [ __( 'Template' ), '' ];
? __( 'Template (selected)' )
: __( 'Template' );

return (
<>
Expand All @@ -60,14 +60,12 @@ const SettingsHeader = ( { sidebarName } ) => {
isTemplateMode ? (
<Button
onClick={ openDocumentSettings }
className={ `edit-post-sidebar__panel-tab` }
aria-label={ templateAriaLabel }
data-label={ __( 'Template' ) }
/>
) : (
<Button
onClick={ openDocumentSettings }
className={ `edit-post-sidebar__panel-tab` }
aria-label={ documentAriaLabel }
data-label={ documentLabel }
/>
Expand All @@ -81,13 +79,10 @@ const SettingsHeader = ( { sidebarName } ) => {
render={
<Button
onClick={ openBlockSettings }
className={ `edit-post-sidebar__panel-tab` }
aria-label={ blockAriaLabel }
// translators: Data label for the Block Settings Sidebar tab.
data-label={ __( 'Block' ) }
>
{ }
</Button>
/>
}
>
{ /* translators: Text label for the Block Settings Sidebar tab. */ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ const SettingsSidebar = () => {
);

const Content = () => {
// Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we
// need to forward the `Tabs` context so it can be passed through the
// underlying slot/fill.
const tabsContextValue = useContext( Tabs.Context );

return (
Expand Down

0 comments on commit 6aa72d6

Please sign in to comment.