From 6aa72d6c276b836748bd7d5fe543b767e3e1f921 Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:03:10 -0400 Subject: [PATCH] incorporate initial feedback --- .../sidebar/settings-header/index.js | 25 ++++++++----------- .../sidebar/settings-sidebar/index.js | 3 +++ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/packages/edit-post/src/components/sidebar/settings-header/index.js b/packages/edit-post/src/components/sidebar/settings-header/index.js index 55e47f8232c09..28a6d555ac40d 100644 --- a/packages/edit-post/src/components/sidebar/settings-header/index.js +++ b/packages/edit-post/src/components/sidebar/settings-header/index.js @@ -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 ( <> @@ -60,14 +60,12 @@ const SettingsHeader = ( { sidebarName } ) => { isTemplateMode ? ( + /> } > { /* translators: Text label for the Block Settings Sidebar tab. */ } diff --git a/packages/edit-post/src/components/sidebar/settings-sidebar/index.js b/packages/edit-post/src/components/sidebar/settings-sidebar/index.js index 27888504af97d..e8681205b6013 100644 --- a/packages/edit-post/src/components/sidebar/settings-sidebar/index.js +++ b/packages/edit-post/src/components/sidebar/settings-sidebar/index.js @@ -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 (