mirror of
https://github.com/docmost/docmost.git
synced 2026-06-10 10:13:01 +08:00
feat(base): render table icon in sidebar for is_base=true pages
- Add isBase to SpaceTreeNode type - Forward isBase from IPage in buildTree utility - In the sidebar Node renderer, show IconTable when node.data.isBase is true and no custom emoji icon is set
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
IconPointFilled,
|
||||
IconStar,
|
||||
IconStarFilled,
|
||||
IconTable,
|
||||
IconTrash,
|
||||
} from "@tabler/icons-react";
|
||||
import {
|
||||
@@ -422,6 +423,8 @@ function Node({ node, style, dragHandle, tree }: NodeRendererProps<any>) {
|
||||
icon={
|
||||
node.data.icon ? (
|
||||
node.data.icon
|
||||
) : node.data.isBase ? (
|
||||
<IconTable size={18} />
|
||||
) : (
|
||||
<IconFileDescription size="18" />
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@ export type SpaceTreeNode = {
|
||||
spaceId: string;
|
||||
parentPageId: string;
|
||||
hasChildren: boolean;
|
||||
isBase?: boolean;
|
||||
canEdit?: boolean;
|
||||
children: SpaceTreeNode[];
|
||||
};
|
||||
|
||||
@@ -24,6 +24,7 @@ export function buildTree(pages: IPage[]): SpaceTreeNode[] {
|
||||
hasChildren: page.hasChildren,
|
||||
spaceId: page.spaceId,
|
||||
parentPageId: page.parentPageId,
|
||||
isBase: page.isBase,
|
||||
canEdit: page.canEdit ?? page.permissions?.canEdit,
|
||||
children: [],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user