Skip to content

Commit

Permalink
feat: improved the block sections while navigate between master and i…
Browse files Browse the repository at this point in the history
…nners
  • Loading branch information
rezaelahidev committed Oct 23, 2024
1 parent 212df88 commit c6e5693
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { Breadcrumb } from './breadcrumb';
import { default as BlockIcon } from './block-icon';
import type { UpdateBlockEditorSettings } from '../../types';
import type { InnerBlockModel, InnerBlockType } from '../../inner-blocks/types';
import { useBlockSection } from '../../../components';

export function BlockCard({
clientId,
Expand Down Expand Up @@ -83,6 +84,7 @@ export function BlockCard({
};
}, []);
const { selectBlock } = useDispatch(blockEditorStore);
const { onToggle } = useBlockSection('innerBlocksConfig');

return (
<div
Expand Down Expand Up @@ -160,6 +162,7 @@ export function BlockCard({
'current-block',
'master'
);
onToggle(true);
}
}}
aria-label={__('Selected Block', 'blockera')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { default as BlockIcon } from './block-icon';
import type { UpdateBlockEditorSettings } from '../../types';
import type { InnerBlockModel, InnerBlockType } from '../../inner-blocks/types';
import StateContainer from '../../../components/state-container';
import { useBlockSection } from '../../../components';

export function InnerBlockCard({
clientId,
Expand Down Expand Up @@ -64,6 +65,7 @@ export function InnerBlockCard({
};

const blockInformation = getInnerBlockDetails();
const { onToggle } = useBlockSection('innerBlocksConfig');

return (
<div
Expand Down Expand Up @@ -108,9 +110,10 @@ export function InnerBlockCard({
library="wp"
icon="close-small"
iconSize="24"
onClick={() =>
handleOnClick('current-block', 'master')
}
onClick={() => {
onToggle(true);
handleOnClick('current-block', 'master');
}}
/>
</Tooltip>
</h2>
Expand Down

0 comments on commit c6e5693

Please sign in to comment.