Revert "Merge pull request #42 from toeverything/feat/sub-page"

This reverts commit cf6491fb0c, reversing
changes made to e12deb302f.
This commit is contained in:
DarkSky
2022-08-05 22:06:31 +08:00
parent cf6491fb0c
commit ecc7080179
16 changed files with 63 additions and 164 deletions

View File

@@ -25,7 +25,7 @@ const AddCard = ({ group }: { group: KanbanGroup }) => {
const { addCard } = useKanban();
const handleClick = useCallback(async () => {
await addCard(group);
}, [addCard, group]);
}, [addCard]);
return <AddCardWrapper onClick={handleClick}>+</AddCardWrapper>;
};

View File

@@ -1,11 +1,6 @@
import type { KanbanCard } from '@toeverything/components/editor-core';
import {
RenderBlock,
useKanban,
useRefPage,
} from '@toeverything/components/editor-core';
import { RenderBlock, useKanban } from '@toeverything/components/editor-core';
import { styled } from '@toeverything/components/ui';
import { useFlag } from '@toeverything/datasource/feature-flags';
const CardContent = styled('div')({
margin: '20px',
@@ -63,24 +58,18 @@ export const CardItem = ({
block: KanbanCard['block'];
}) => {
const { addSubItem } = useKanban();
const { openSubPage } = useRefPage();
const showKanbanRefPageFlag = useFlag('ShowKanbanRefPage', false);
const onAddItem = async () => {
await addSubItem(block);
};
const onClickCard = async () => {
showKanbanRefPageFlag && openSubPage(id);
};
return (
<CardContainer onClick={onClickCard}>
<CardContainer>
<CardContent>
<RenderBlock blockId={id} />
</CardContent>
<CardActions onClick={onAddItem}>
<PlusIcon />
<span>Add a sub-block</span>
<span>Add item</span>
</CardActions>
</CardContainer>
);