mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
d2717a221c
* dev: context menu * chore: handle menu position on close * chore: project quick actions * chore: add more options to the project context menu * chore: cycle item context menu * refactor: context menu folder structure * chore: module custom context menu * chore: view custom context menu * chore: issues custom context menu * chore: reorder options * chore: issues custom context menu * chore: render the context menu in a portal
34 lines
985 B
TypeScript
34 lines
985 B
TypeScript
import { FC, useRef } from "react";
|
|
import { observer } from "mobx-react";
|
|
// components
|
|
import { ListItem } from "@/components/core/list";
|
|
import { BlockItemAction } from "@/components/pages/list";
|
|
// hooks
|
|
import { usePage } from "@/hooks/store";
|
|
import { usePlatformOS } from "@/hooks/use-platform-os";
|
|
|
|
type TPageListBlock = {
|
|
workspaceSlug: string;
|
|
projectId: string;
|
|
pageId: string;
|
|
};
|
|
|
|
export const PageListBlock: FC<TPageListBlock> = observer((props) => {
|
|
const { workspaceSlug, projectId, pageId } = props;
|
|
// refs
|
|
const parentRef = useRef(null);
|
|
// hooks
|
|
const { name } = usePage(pageId);
|
|
const { isMobile } = usePlatformOS();
|
|
|
|
return (
|
|
<ListItem
|
|
title={name ?? ""}
|
|
itemLink={`/${workspaceSlug}/projects/${projectId}/pages/${pageId}`}
|
|
actionableItems={<BlockItemAction workspaceSlug={workspaceSlug} projectId={projectId} pageId={pageId} parentRef={parentRef} />}
|
|
isMobile={isMobile}
|
|
parentRef={parentRef}
|
|
/>
|
|
);
|
|
});
|