Files
supabase/apps/studio/components/layouts/AppLayout/InlineEditorButton.tsx
CharisandJoshen Lim 3eb7da7766 feat(preferences): allow disable hotkeys (#39573)
* feat(preferences): allow disable hotkeys

Add a section in /account/me for disabling hotkeys. Only added one
hotkey for now (Cmd + E for toggling editor side panel) but we can add
more with the same pattern.

* refactor: remove default export on ProjectLayout

* feat(hotkeys): allow toggling of command menu and ai assistant hotkeys

* Nit

* PRettier lint

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-17 08:09:38 -04:00

34 lines
863 B
TypeScript

import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { SqlEditor } from 'icons'
import { KeyboardShortcut } from 'ui'
export const InlineEditorButton = ({
onClick,
showShortcut = true,
}: {
onClick: () => void
showShortcut?: boolean
}) => {
return (
<ButtonTooltip
type="text"
size="tiny"
id="editor-trigger"
className="rounded-none w-[32px] h-[30px] flex items-center justify-center p-0 text-foreground-light hover:text-foreground"
onClick={onClick}
tooltip={{
content: {
text: (
<div className="flex items-center gap-4">
<span>SQL Editor</span>
{showShortcut && <KeyboardShortcut keys={['Meta', 'e']} />}
</div>
),
},
}}
>
<SqlEditor size={18} strokeWidth={1.5} />
</ButtonTooltip>
)
}