From 05b2a167463fdfa7cf4dff13251d94ea36bef084 Mon Sep 17 00:00:00 2001 From: karamvir Date: Wed, 2 Aug 2023 20:28:49 -0700 Subject: [PATCH] copy name when click it --- frontend/src/components/util.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/util.tsx b/frontend/src/components/util.tsx index 495da080d..c9d6f985a 100644 --- a/frontend/src/components/util.tsx +++ b/frontend/src/components/util.tsx @@ -10,6 +10,8 @@ import { DialogContent, DialogFooter, } from "@ui/dialog"; +// import { useNavigate } from "react-router-dom"; +import { toast } from "@ui/toast/use-toast"; export const WithLoading = ({ children, @@ -122,8 +124,18 @@ export const ActionWithDialog = ({ Confirm {title}
-

+

{ + navigator.clipboard.writeText(name); + toast({ title: `Copied "${name}" to clipboard!` }); + }} + className="cursor-pointer" + > Please enter {name} below to confirm this action. +
+ + You may click the name in bold to copy it +

setInput(e.target.value)} />