From d14e13d4e44388e0ebceb67b54e56c9d0a08e122 Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Sun, 9 Jun 2024 18:51:31 -0300 Subject: [PATCH] Feat: Add shortcut to open flow share modal --- .../src/components/chatComponent/index.tsx | 15 +++++++--- src/frontend/src/constants/constants.ts | 4 +++ src/frontend/src/modals/shareModal/index.tsx | 28 ++++++++----------- src/frontend/src/stores/shortcuts.ts | 1 + src/frontend/src/types/store/index.ts | 1 + 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 6fc0da4b9..f0d7922d4 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -30,11 +30,11 @@ export default function FlowToolbar(): JSX.Element { const openPlayground = useShortcutsStore((state) => state.open); const api = useShortcutsStore((state) => state.api); - const share = useShortcutsStore((state) => state.share); + const flow = useShortcutsStore((state) => state.flow); useHotkeys(openPlayground, handleChatWShortcut, { preventDefault }); useHotkeys(api, handleAPIWShortcut, { preventDefault }); - useHotkeys(share, handleShareWShortcut, { preventDefault }); + useHotkeys(flow, handleShareWShortcut, { preventDefault }); const [open, setOpen] = useState(false); const [openCodeModal, setOpenCodeModal] = useState(false); @@ -55,7 +55,7 @@ export default function FlowToolbar(): JSX.Element { component={currentFlow!} disabled={!hasApiKey || !validApiKey || !hasStore} open={openShareModal} - setOpen={setOpen} + setOpen={setOpenShareModal} >