forked from github/plane
feat: add create page option in cmdk menu (#799)
This commit is contained in:
parent
d6dbfdc731
commit
34ff8fecc5
@ -179,6 +179,7 @@ export const CommandPalette: React.FC = () => {
|
|||||||
(e: KeyboardEvent) => {
|
(e: KeyboardEvent) => {
|
||||||
const singleShortcutKeys = ["p", "v", "d", "h", "q", "m"];
|
const singleShortcutKeys = ["p", "v", "d", "h", "q", "m"];
|
||||||
const { key, ctrlKey, metaKey, altKey, shiftKey } = e;
|
const { key, ctrlKey, metaKey, altKey, shiftKey } = e;
|
||||||
|
if (!key) return;
|
||||||
const keyPressed = key.toLowerCase();
|
const keyPressed = key.toLowerCase();
|
||||||
if (
|
if (
|
||||||
!(e.target instanceof HTMLTextAreaElement) &&
|
!(e.target instanceof HTMLTextAreaElement) &&
|
||||||
@ -299,6 +300,11 @@ export const CommandPalette: React.FC = () => {
|
|||||||
setIsCreateViewModalOpen(true);
|
setIsCreateViewModalOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const createNewPage = () => {
|
||||||
|
setIsPaletteOpen(false);
|
||||||
|
setIsCreateUpdatePageModalOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
const createNewModule = () => {
|
const createNewModule = () => {
|
||||||
setIsPaletteOpen(false);
|
setIsPaletteOpen(false);
|
||||||
setIsCreateModuleModalOpen(true);
|
setIsCreateModuleModalOpen(true);
|
||||||
@ -654,7 +660,17 @@ export const CommandPalette: React.FC = () => {
|
|||||||
<ViewListIcon className="h-4 w-4" color="#6b7280" />
|
<ViewListIcon className="h-4 w-4" color="#6b7280" />
|
||||||
Create new view
|
Create new view
|
||||||
</div>
|
</div>
|
||||||
<kbd>Q</kbd>
|
<kbd>V</kbd>
|
||||||
|
</Command.Item>
|
||||||
|
</Command.Group>
|
||||||
|
|
||||||
|
<Command.Group heading="Page">
|
||||||
|
<Command.Item onSelect={createNewPage} className="focus:outline-none">
|
||||||
|
<div className="flex items-center gap-2 text-gray-700">
|
||||||
|
<DocumentTextIcon className="h-4 w-4" color="#6b7280" />
|
||||||
|
Create new page
|
||||||
|
</div>
|
||||||
|
<kbd>D</kbd>
|
||||||
</Command.Item>
|
</Command.Item>
|
||||||
</Command.Group>
|
</Command.Group>
|
||||||
</>
|
</>
|
||||||
|
Loading…
Reference in New Issue
Block a user