Skip to content

Commit

Permalink
Rename component to OverridesPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Apr 2, 2024
1 parent 69d8af5 commit c0c23fd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { unlock } from '../../../lock-unlock';
const { PostCardPanel } = unlock( editorPrivateApis );

const { Tabs } = unlock( componentsPrivateApis );
const { PatternContentPanel } = unlock( editorPrivateApis );
const { PatternOverridesPanel } = unlock( editorPrivateApis );

const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {
web: true,
Expand Down Expand Up @@ -124,7 +124,7 @@ const SidebarContent = ( {
<PostExcerptPanel />
<PostDiscussionPanel />
<PageAttributesPanel />
<PatternContentPanel />
<PatternOverridesPanel />
<MetaBoxes location="side" />
</>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { TEMPLATE_PART_POST_TYPE } from '../../../utils/constants';
import { unlock } from '../../../lock-unlock';

const { PostCardPanel } = unlock( editorPrivateApis );
const { PatternContentPanel } = unlock( editorPrivateApis );
const { PatternOverridesPanel } = unlock( editorPrivateApis );
const { useHistory } = unlock( routerPrivateApis );

function TemplatesList( { availableTemplates, onSelect } ) {
Expand Down Expand Up @@ -141,7 +141,7 @@ export default function TemplatePanel() {
<PostExcerptPanel />
<PostDiscussionPanel />
<PageAttributesPanel />
<PatternContentPanel />
<PatternOverridesPanel />
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
import { store as editorStore } from '../../store';
import { unlock } from '../../lock-unlock';

const { ContentPanel } = unlock( patternsPrivateApis );
const { OverridesPanel } = unlock( patternsPrivateApis );

export default function PatternContentPanel() {
const supportsPatternContentPanel = useSelect(
export default function PatternOverridesPanel() {
const supportsPatternOverridesPanel = useSelect(
( select ) => select( editorStore ).getCurrentPostType() === 'wp_block',
[]
);

if ( ! supportsPatternContentPanel ) {
if ( ! supportsPatternOverridesPanel ) {
return null;
}

return <ContentPanel />;
return <OverridesPanel />;
}
4 changes: 2 additions & 2 deletions packages/editor/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import DocumentTools from './components/document-tools';
import InserterSidebar from './components/inserter-sidebar';
import ListViewSidebar from './components/list-view-sidebar';
import ModeSwitcher from './components/mode-switcher';
import PatternContentPanel from './components/pattern-content-panel';
import PatternOverridesPanel from './components/pattern-overrides-panel';
import PluginPostExcerpt from './components/post-excerpt/plugin';
import PostPanelRow from './components/post-panel-row';
import PostViewLink from './components/post-view-link';
Expand All @@ -28,7 +28,7 @@ lock( privateApis, {
InserterSidebar,
ListViewSidebar,
ModeSwitcher,
PatternContentPanel,
PatternOverridesPanel,
PluginPostExcerpt,
PostPanelRow,
PostViewLink,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { unlock } from '../lock-unlock';

const { BlockQuickNavigation } = unlock( blockEditorPrivateApis );

export default function ContentPanel() {
export default function OverridesPanel() {
const allClientIds = useSelect(
( select ) => select( blockEditorStore ).getClientIdsWithDescendants(),
[]
Expand Down
4 changes: 2 additions & 2 deletions packages/patterns/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Internal dependencies
*/
import { lock } from './lock-unlock';
import ContentPanel from './components/content-panel';
import OverridesPanel from './components/overrides-panel';
import {
default as CreatePatternModal,
CreatePatternModalContents,
Expand All @@ -29,7 +29,7 @@ import {

export const privateApis = {};
lock( privateApis, {
ContentPanel,
OverridesPanel,
CreatePatternModal,
CreatePatternModalContents,
DuplicatePatternModal,
Expand Down

0 comments on commit c0c23fd

Please sign in to comment.