Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move command palette out of header into main menu #535

Merged
merged 3 commits into from
May 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/ui/menus/TopBar/SubMenus/QuadraticMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { isMac } from '../../../../utils/isMac';
import { ContentCopy, ContentCut, ContentPaste, Undo, Redo } from '@mui/icons-material';
import { editorInteractionStateAtom } from '../../../../atoms/editorInteractionStateAtom';
import { useLocalFiles } from '../../../contexts/LocalFiles';
import { focusGrid } from '../../../../helpers/focusGrid';

interface Props {
sheetController: SheetController;
Expand Down Expand Up @@ -61,6 +62,18 @@ export const QuadraticMenu = (props: Props) => {
<MenuLineItem primary="Back to files" secondary={KeyboardSymbols.Command + 'O'} />
</MenuItem>
<MenuDivider />
<MenuItem
onClick={() => {
setEditorInteractionState({
...editorInteractionState,
showCommandPalette: true,
});
focusGrid();
}}
>
<MenuLineItem primary="Command palette" secondary={KeyboardSymbols.Command + 'P'} />
</MenuItem>
<MenuDivider />
<SubMenu label="File">
<MenuItem onClick={createNewFile}>New</MenuItem>
<MenuItem onClick={() => downloadCurrentFile()}>Download local copy</MenuItem>
Expand Down Expand Up @@ -178,7 +191,6 @@ export const QuadraticMenu = (props: Props) => {
>
Show A1 notation on headings
</MenuItem> */}
<MenuDivider />
</SubMenu>

{isAuthenticated && (
Expand Down