From a750f284a541d2b3e8c600165d5bf74bf33c7e0d Mon Sep 17 00:00:00 2001 From: "maige-app[bot]" <303827+maige-app[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:32:25 +0000 Subject: [PATCH] feat: Add copy button next to npx dockhunt command on /add-dock route --- src/pages/add-dock.tsx | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/pages/add-dock.tsx b/src/pages/add-dock.tsx index b0ae512..040c6df 100644 --- a/src/pages/add-dock.tsx +++ b/src/pages/add-dock.tsx @@ -6,6 +6,16 @@ import { desktopAppDownloadLink } from "utils/constants"; import { useSession } from "next-auth/react"; import { api } from "../utils/api"; +const copyToClipboard = async (text) => { + try { + await navigator.clipboard.writeText(text); + // Optional: Display feedback to the user + alert('Command copied to clipboard!'); + } catch (err) { + console.error('Failed to copy: ', err); + } +}; + const AddDock = () => { const { data: sessionData } = useSession(); const user = api.users.getOne.useQuery({ id: sessionData?.user?.id ?? "" }); @@ -62,9 +72,17 @@ const AddDock = () => { To add your own dock, run the following command in your{" "} terminal:

- - npx dockhunt - +
+ + npx dockhunt + + +

The command will:

  1. Find the apps in your dock
  2. @@ -108,4 +126,4 @@ const AddDock = () => { ); }; -export default AddDock; +export default AddDock; \ No newline at end of file