From 34fbf7db9cc98e7eaf500bc84598d6bada493830 Mon Sep 17 00:00:00 2001 From: Atul Bhatt <38177419+atulbhatt-system32@users.noreply.github.com> Date: Thu, 21 Dec 2023 15:40:14 +0530 Subject: [PATCH] Add support and community page links --- src/pages/main/hooks/useCmdk.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/pages/main/hooks/useCmdk.ts b/src/pages/main/hooks/useCmdk.ts index 46ffff3f..cbe70a6c 100644 --- a/src/pages/main/hooks/useCmdk.ts +++ b/src/pages/main/hooks/useCmdk.ts @@ -185,6 +185,16 @@ export const useCmdk = ({ cmdkReferenceData, importProject }: IUseCmdk) => { const onOpenGuidePage = useCallback(() => { window.open("https://guide.rnbw.dev", "_blank", "noreferrer"); }, []); + const onOpenSupportPage = useCallback(() => { + window.open( + "https://github.com/orgs/rnbwdev/discussions", + "_blank", + "noreferrer", + ); + }, []); + const onOpenCommunityPage = useCallback(() => { + window.open("https://discord.gg/HycXz8TJkd", "_blank", "noreferrer"); + }, []); const onToggleTheme = useCallback(() => { switch (theme) { case "System": @@ -297,7 +307,6 @@ export const useCmdk = ({ cmdkReferenceData, importProject }: IUseCmdk) => { }, [KeyDownEventListener]); useEffect(() => { if (!currentCommand) return; - switch (currentCommand.action) { case "Jumpstart": onJumpstart(); @@ -337,6 +346,12 @@ export const useCmdk = ({ cmdkReferenceData, importProject }: IUseCmdk) => { case "Guide": onOpenGuidePage(); break; + case "Support": + onOpenSupportPage(); + break; + case "Community": + onOpenCommunityPage(); + break; case "Download": onDownload(); break;