From 507af5b54fce3e0a10d8252676c90de7d75e5c60 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:34:40 +0000 Subject: [PATCH] Implemented copy button feature for command --- src/pages/add-dock.tsx | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/pages/add-dock.tsx b/src/pages/add-dock.tsx index b0ae512..660b7da 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 copyToClipboard = () => { + navigator.clipboard.writeText('npx dockhunt').then(() => { + alert('Command copied to clipboard!'); + }, (err) => { + console.error('Could not copy text: ', err); + }); + }; + return ( <> @@ -46,7 +54,7 @@ const AddDock = () => {

- To add your own dock, run the following command in your{" "} + 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