Skip to content

Commit

Permalink
Fix Help Centers Icon Scope
Browse files Browse the repository at this point in the history
To support WP 6.5
  • Loading branch information
alshakero committed May 23, 2024
1 parent 554abd0 commit 1f343f4
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ import { whatsNewQueryClient } from '../../common/what-new-query-client';
import CalypsoStateProvider from './CalypsoStateProvider';
import useActionHooks from './use-action-hooks';

// Implement PinnedItems to avoid importing @wordpress/interface.
// Because @wordpress/interface depends on @wordpress/preferences which is not always available outside the editor,
// causing the script to not be enqueued due to the missing dependency.
// check https://github.com/Automattic/wp-calypso/pull/74122 for more details.
function PinnedItems( { scope, ...props } ) {
return <Fill name={ `PinnedItems/${ scope }` } { ...props } />;
}

function HelpCenterContent() {
const [ helpIconRef, setHelpIconRef ] = useState();
const isDesktop = useMediaQuery( '(min-width: 480px)' );
Expand Down Expand Up @@ -74,13 +66,7 @@ function HelpCenterContent() {

return (
<>
{ isDesktop && showHelpIcon && (
<>
<PinnedItems scope="core/edit-post">{ content }</PinnedItems>
<PinnedItems scope="core/edit-site">{ content }</PinnedItems>
<PinnedItems scope="core/edit-widgets">{ content }</PinnedItems>
</>
) }
{ isDesktop && showHelpIcon && <Fill name="PinnedItems/core">{ content }</Fill> }
<HelpCenter handleClose={ closeCallback } />
</>
);
Expand Down

0 comments on commit 1f343f4

Please sign in to comment.