From 6db95e6acdc6b62937627fddd5b5e58b347923c7 Mon Sep 17 00:00:00 2001 From: Maciej Bodek Date: Tue, 28 Jan 2025 18:15:38 +0100 Subject: [PATCH] updates --- .../web-console/src/scenes/Layout/help.tsx | 102 ++++++++++++------ 1 file changed, 67 insertions(+), 35 deletions(-) diff --git a/packages/web-console/src/scenes/Layout/help.tsx b/packages/web-console/src/scenes/Layout/help.tsx index 9551eef7a..a1338915d 100644 --- a/packages/web-console/src/scenes/Layout/help.tsx +++ b/packages/web-console/src/scenes/Layout/help.tsx @@ -1,5 +1,10 @@ -import React from "react" -import { Chat3, Command, Question } from "@styled-icons/remix-line" +import React, { useEffect } from "react" +import { + Chat3, + Command, + ExternalLink, + Question, +} from "@styled-icons/remix-line" import { Discourse, Github, @@ -13,9 +18,14 @@ import { Link, PopperToggle, } from "../../components" -import { DropdownMenu, FeedbackDialog, Box } from "@questdb/react-components" +import { + DropdownMenu, + FeedbackDialog, + ForwardRef, + Box, +} from "@questdb/react-components" import { BUTTON_ICON_SIZE } from "../../consts" -import { IconWithTooltip } from "../../components" +import { IconWithTooltip, useKeyPress } from "../../components" import { useState, useCallback, useContext } from "react" import { QuestContext } from "../../providers" import { useSelector } from "react-redux" @@ -59,8 +69,13 @@ const MenuLink: React.FunctionComponent<{ target="_blank" {...rest} > - {icon} - {text} + + {icon} + + {text} + + + ) @@ -73,6 +88,13 @@ export const Help = () => { }, []) const [open, setOpen] = useState(false) const [feedbackOpen, setFeedbackOpen] = useState(false) + const escPress = useKeyPress("Escape") + + useEffect(() => { + if (escPress && shortcutsPopperActive) { + setShortcutsPopperActive(false) + } + }, [escPress]) return ( @@ -132,47 +154,57 @@ export const Help = () => { Contact us - } - /> + + } + /> + - } - /> + + } + /> + - } - /> + + } + /> + - } - /> + + } + /> + handleShortcutsToggle(true)}> Shortcuts - } - /> + + } + /> +