Remove CMD+SHIFT+P command, update dependencies, update extensions.json
This commit is contained in:
parent
5440561ac8
commit
1d446b9c56
|
@ -4,6 +4,7 @@
|
|||
"recommendations": [
|
||||
"editorconfig.editorconfig",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"davidanson.vscode-markdownlint"
|
||||
"davidanson.vscode-markdownlint",
|
||||
"streetsidesoftware.code-spell-checker"
|
||||
]
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -47,14 +47,8 @@ import {
|
|||
} from '@ant-design/icons';
|
||||
import { useKBar } from 'kbar';
|
||||
import store from '../store';
|
||||
import {
|
||||
isMac,
|
||||
isFirefox,
|
||||
} from '../utils/env';
|
||||
import {
|
||||
isCommand,
|
||||
isToggleSidebar,
|
||||
} from '../utils/keyboard/shortcuts';
|
||||
import { isMac } from '../utils/env';
|
||||
import { isToggleSidebar } from '../utils/keyboard/shortcuts';
|
||||
import { Routes } from '../routes';
|
||||
import { useAuth } from '../contexts/AuthContext';
|
||||
import {
|
||||
|
@ -93,16 +87,11 @@ const TopBar = ({ tuneId }: { tuneId: string | null }) => {
|
|||
const toggleCommandPalette = useCallback(() => query.toggle(), [query]);
|
||||
|
||||
const handleGlobalKeyboard = useCallback((e: KeyboardEvent) => {
|
||||
if (isCommand(e)) {
|
||||
e.preventDefault();
|
||||
toggleCommandPalette();
|
||||
}
|
||||
|
||||
if (isToggleSidebar(e)) {
|
||||
e.preventDefault();
|
||||
store.dispatch({ type: 'ui/toggleSidebar' });
|
||||
}
|
||||
}, [toggleCommandPalette]);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
document.addEventListener('keydown', handleGlobalKeyboard);
|
||||
|
@ -190,17 +179,10 @@ const TopBar = ({ tuneId }: { tuneId: string | null }) => {
|
|||
<Col {...rightMenuColProps} style={{ textAlign: 'right' }}>
|
||||
<Space>
|
||||
{sm && <Tooltip title={
|
||||
isFirefox ?
|
||||
(<>
|
||||
<Typography.Text keyboard>{isMac ? '⌘' : 'CTRL'}</Typography.Text>
|
||||
<Typography.Text keyboard>K</Typography.Text>
|
||||
</>)
|
||||
:
|
||||
(<>
|
||||
<Typography.Text keyboard>{isMac ? '⌘' : 'CTRL'}</Typography.Text>
|
||||
<Typography.Text keyboard>SHIFT</Typography.Text>
|
||||
<Typography.Text keyboard>P</Typography.Text>
|
||||
</>)
|
||||
<>
|
||||
<Typography.Text keyboard>{isMac ? '⌘' : 'CTRL'}</Typography.Text>
|
||||
<Typography.Text keyboard>K</Typography.Text>
|
||||
</>
|
||||
}>
|
||||
<Button icon={<SearchOutlined />} onClick={toggleCommandPalette} />
|
||||
</Tooltip>}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
export const isMac = `${window.navigator.platform}`.includes('Mac');
|
||||
export const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
||||
export const environment = import.meta.env.NODE_ENV || 'development';
|
||||
export const isProduction = environment === 'production';
|
||||
export const sentryDsn = import.meta.env.VITE_SENTRY_DSN;
|
||||
|
|
|
@ -3,11 +3,9 @@ import React from 'react';
|
|||
type KeyEvent = KeyboardEvent | React.KeyboardEvent<HTMLInputElement>;
|
||||
|
||||
enum Keys {
|
||||
COMMAND = 'p',
|
||||
SIDEBAR = '\\',
|
||||
ESCAPE = 'Escape',
|
||||
}
|
||||
|
||||
export const isCommand = (e: KeyEvent) => (e.metaKey || e.ctrlKey) && e.shiftKey && e.key === Keys.COMMAND;
|
||||
export const isToggleSidebar = (e: KeyEvent) => (e.metaKey || e.ctrlKey) && e.key === Keys.SIDEBAR;
|
||||
export const isEscape = (e: KeyEvent) => e.key === Keys.ESCAPE;
|
||||
|
|
Loading…
Reference in New Issue