From d666d2699dea52daa55ea10321f935e522ca1b68 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:28:55 +0000 Subject: [PATCH] feat: Add copy button next to npx dockhunt command --- src/pages/add-dock.tsx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/pages/add-dock.tsx b/src/pages/add-dock.tsx index b0ae512..d60900a 100644 --- a/src/pages/add-dock.tsx +++ b/src/pages/add-dock.tsx @@ -10,6 +10,14 @@ const AddDock = () => { const { data: sessionData } = useSession(); const user = api.users.getOne.useQuery({ id: sessionData?.user?.id ?? "" }); + const copyCommandToClipboard = () => { + navigator.clipboard.writeText('npx dockhunt').then(() => { + alert('Command copied to clipboard!'); + }, (err) => { + console.error('Could not copy command: ', err); + }); + }; + return ( <>
@@ -62,9 +70,17 @@ const AddDock = () => { To add your own dock, run the following command in your{" "} terminal: -
- npx dockhunt
-
+
+ npx dockhunt
+
+
+ The command will: