fix: remove special menu

This commit is contained in:
lawvs
2022-09-15 19:09:45 +08:00
parent 85a2f1d6d6
commit c5a6e94a71
2 changed files with 8 additions and 15 deletions

View File

@@ -39,14 +39,6 @@ type MenuItemsProps = {
export const CommonList = (props: MenuItemsProps) => { export const CommonList = (props: MenuItemsProps) => {
const { items, currentItem, setCurrentItem, onSelected } = props; const { items, currentItem, setCurrentItem, onSelected } = props;
// const JSONUnsupportedBlockTypes = useFlag('JSONUnsupportedBlockTypes', [
// 'page',
// ]);
// TODO Insert bidirectional link to be developed
const JSONUnsupportedBlockTypes = ['page'];
const usedItems = items.filter(item => {
return !JSONUnsupportedBlockTypes.includes(item?.content?.id);
});
return ( return (
<div className={clsx(styles('root_container'), props.className)}> <div className={clsx(styles('root_container'), props.className)}>
<div <div
@@ -55,8 +47,8 @@ export const CommonList = (props: MenuItemsProps) => {
commonListContainer, commonListContainer,
])} ])}
> >
{usedItems?.length ? ( {items?.length ? (
usedItems.map((item, idx) => { items.map((item, idx) => {
if (item.renderCustom) { if (item.renderCustom) {
return item.renderCustom(item); return item.renderCustom(item);
} else if (item.block) { } else if (item.block) {

View File

@@ -68,11 +68,12 @@ export const menuItemsMap: {
type: Protocol.Block.Type.text, type: Protocol.Block.Type.text,
icon: TextIcon, icon: TextIcon,
}, },
{ // the Page block should not be inserted
text: 'Page', // {
type: 'page', // text: 'Page',
icon: PagesIcon, // type: Protocol.Block.Type.page,
}, // icon: PagesIcon,
// },
{ {
text: 'Heading 1', text: 'Heading 1',
type: Protocol.Block.Type.heading1, type: Protocol.Block.Type.heading1,