Skip to content

Commit

Permalink
Update copy and default to pages open
Browse files Browse the repository at this point in the history
  • Loading branch information
oakesjosh committed Jul 31, 2024
1 parent 2afb76c commit e4980d6
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions src/blocks/navigation/components/menu-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useSelect } from '@wordpress/data';
import { PostSelectorCheckbox, KadenceRadioButtons } from '@kadence/components';
import { createBlock } from '@wordpress/blocks';
import { TextControl, Button } from '@wordpress/components';
import { link } from '@wordpress/icons';
import { plus } from '@wordpress/icons';

import MenuEdit from './edit';
import './editor.scss';
Expand All @@ -23,7 +23,7 @@ export default function MenuEditor({
orientationTablet,
setMetaAttribute,
}) {
const [sidebarTab, setSidebarTab] = useState('posts');
const [sidebarTab, setSidebarTab] = useState('page');

const { blocks } = useSelect(
(select) => {
Expand Down Expand Up @@ -100,34 +100,6 @@ export default function MenuEditor({
onSelect={onSelect}
/>
))}

<PostSelectorCheckbox
forceOpen={sidebarTab === 'posts'}
useForceState={true}
title={__('Posts', 'kadence-blocks')}
onPanelBodyToggle={() => setSidebarTab(sidebarTab === 'posts' ? null : 'posts')}
onSelect={onSelect}
/>

<PostSelectorCheckbox
forceOpen={sidebarTab === 'pages'}
useForceState={true}
onPanelBodyToggle={() => setSidebarTab(sidebarTab === 'pages' ? null : 'pages')}
postType={'pages'}
title={__('Pages', 'kadence-blocks')}
onSelect={onSelect}
/>

{kadence_blocks_params.hasProducts && (
<PostSelectorCheckbox
forceOpen={sidebarTab === 'product'}
useForceState={true}
onPanelBodyToggle={() => setSidebarTab(sidebarTab === 'product' ? null : 'product')}
postType={'product'}
title={__('Products', 'kadence-blocks')}
onSelect={onSelect}
/>
)}
</div>
<div className={'add-menu'}></div>
</div>
Expand Down Expand Up @@ -156,9 +128,9 @@ export default function MenuEditor({
}),
]);
}}
icon={link}
icon={plus}
>
{__('Add Link', 'kadence-blocks')}
{__('Custom Link', 'kadence-blocks')}
</Button>
<Button isPrimary onClick={closeModal}>
{__('Done', 'kadence-blocks')}
Expand Down

0 comments on commit e4980d6

Please sign in to comment.