forked from github/plane
5b0066140f
* chore: format all files in the project * fix: removing @types/react from dependencies * fix: adding prettier and eslint config * chore: format files * fix: upgrading turbo version * chore: ignoring warnings and adding todos * fix: updated the type of bubble menu item in the document editor * chore: format files --------- Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
86 lines
2.4 KiB
TypeScript
86 lines
2.4 KiB
TypeScript
import { Command } from "cmdk";
|
|
import { ContrastIcon, FileText } from "lucide-react";
|
|
// mobx store
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
// ui
|
|
import { DiceIcon, PhotoFilterIcon } from "@plane/ui";
|
|
|
|
type Props = {
|
|
closePalette: () => void;
|
|
};
|
|
|
|
export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
|
|
const { closePalette } = props;
|
|
|
|
const {
|
|
commandPalette: { toggleCreateCycleModal, toggleCreateModuleModal, toggleCreatePageModal, toggleCreateViewModal },
|
|
trackEvent: { setTrackElement },
|
|
} = useMobxStore();
|
|
|
|
return (
|
|
<>
|
|
<Command.Group heading="Cycle">
|
|
<Command.Item
|
|
onSelect={() => {
|
|
closePalette();
|
|
setTrackElement("COMMAND_PALETTE");
|
|
toggleCreateCycleModal(true);
|
|
}}
|
|
className="focus:outline-none"
|
|
>
|
|
<div className="flex items-center gap-2 text-custom-text-200">
|
|
<ContrastIcon className="h-3.5 w-3.5" />
|
|
Create new cycle
|
|
</div>
|
|
<kbd>Q</kbd>
|
|
</Command.Item>
|
|
</Command.Group>
|
|
<Command.Group heading="Module">
|
|
<Command.Item
|
|
onSelect={() => {
|
|
closePalette();
|
|
toggleCreateModuleModal(true);
|
|
}}
|
|
className="focus:outline-none"
|
|
>
|
|
<div className="flex items-center gap-2 text-custom-text-200">
|
|
<DiceIcon className="h-3.5 w-3.5" />
|
|
Create new module
|
|
</div>
|
|
<kbd>M</kbd>
|
|
</Command.Item>
|
|
</Command.Group>
|
|
<Command.Group heading="View">
|
|
<Command.Item
|
|
onSelect={() => {
|
|
closePalette();
|
|
toggleCreateViewModal(true);
|
|
}}
|
|
className="focus:outline-none"
|
|
>
|
|
<div className="flex items-center gap-2 text-custom-text-200">
|
|
<PhotoFilterIcon className="h-3.5 w-3.5" />
|
|
Create new view
|
|
</div>
|
|
<kbd>V</kbd>
|
|
</Command.Item>
|
|
</Command.Group>
|
|
<Command.Group heading="Page">
|
|
<Command.Item
|
|
onSelect={() => {
|
|
closePalette();
|
|
toggleCreatePageModal(true);
|
|
}}
|
|
className="focus:outline-none"
|
|
>
|
|
<div className="flex items-center gap-2 text-custom-text-200">
|
|
<FileText className="h-3.5 w-3.5" />
|
|
Create new page
|
|
</div>
|
|
<kbd>D</kbd>
|
|
</Command.Item>
|
|
</Command.Group>
|
|
</>
|
|
);
|
|
};
|