diff --git a/apps/studio/components/layouts/AppLayout/InlineEditorButton.tsx b/apps/studio/components/layouts/AppLayout/InlineEditorButton.tsx index 03b33b3ceb5..db0a6d6bffa 100644 --- a/apps/studio/components/layouts/AppLayout/InlineEditorButton.tsx +++ b/apps/studio/components/layouts/AppLayout/InlineEditorButton.tsx @@ -1,10 +1,21 @@ -import { ButtonTooltip } from 'components/ui/ButtonTooltip' -import { SqlEditor } from 'icons' -import { sidebarManagerState, useSidebarManagerSnapshot } from 'state/sidebar-manager-state' +import { LOCAL_STORAGE_KEYS } from 'common' import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider' +import { ButtonTooltip } from 'components/ui/ButtonTooltip' +import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage' +import { SqlEditor } from 'icons' +import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state' import { cn, KeyboardShortcut } from 'ui' -export const InlineEditorButton = ({ showShortcut = true }: { showShortcut?: boolean }) => { +const InlineEditorKeyboardTooltip = () => { + const [hotkeyEnabled] = useLocalStorageQuery( + LOCAL_STORAGE_KEYS.HOTKEY_SIDEBAR(SIDEBAR_KEYS.EDITOR_PANEL), + true + ) + + return hotkeyEnabled ? : null +} + +export const InlineEditorButton = () => { const { activeSidebar, toggleSidebar } = useSidebarManagerSnapshot() const isOpen = activeSidebar?.id === SIDEBAR_KEYS.EDITOR_PANEL @@ -27,7 +38,7 @@ export const InlineEditorButton = ({ showShortcut = true }: { showShortcut?: boo text: (
SQL Editor - {showShortcut && } +
), },