forked from github/plane
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
36 lines
972 B
TypeScript
36 lines
972 B
TypeScript
import { FC, useRef } from "react";
|
|
import { observer } from "mobx-react-lite";
|
|
import { useRouter } from "next/router";
|
|
// types
|
|
import { IProjectView } from "@plane/types";
|
|
// components
|
|
import { ListItem } from "@/components/core/list";
|
|
import { ViewListItemAction } from "@/components/views";
|
|
// hooks
|
|
import { usePlatformOS } from "@/hooks/use-platform-os";
|
|
|
|
type Props = {
|
|
view: IProjectView;
|
|
};
|
|
|
|
export const ProjectViewListItem: FC<Props> = observer((props) => {
|
|
const { view } = props;
|
|
// refs
|
|
const parentRef = useRef(null);
|
|
// router
|
|
const router = useRouter();
|
|
const { workspaceSlug, projectId } = router.query;
|
|
// store hooks
|
|
const { isMobile } = usePlatformOS();
|
|
|
|
return (
|
|
<ListItem
|
|
title={view.name}
|
|
itemLink={`/${workspaceSlug}/projects/${projectId}/views/${view.id}`}
|
|
actionableItems={<ViewListItemAction parentRef={parentRef} view={view} />}
|
|
isMobile={isMobile}
|
|
parentRef={parentRef}
|
|
/>
|
|
);
|
|
});
|