Skip to content

Commit 44bb10f

Browse files
committed
add copy url button on task modal
1 parent 9600397 commit 44bb10f

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎apps/codebility/app/home/kanban/[projectId]/[id]/_components/tasks/TaskViewModal.tsx‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,34 @@ const TaskViewModal = ({
968968

969969
<DialogFooter className="mt-4 flex justify-end">
970970
{/*Previous style: flex gap-6 sm:justify-end */}
971+
{/* Copy URL button */}
972+
<Button
973+
onClick={() => {
974+
if (!task?.id) {
975+
toast.error("Cannot copy URL: Task ID is missing");
976+
return;
977+
}
978+
979+
const url = new URL(window.location.href);
980+
url.searchParams.set("taskId", task.id);
981+
982+
navigator.clipboard.writeText(url.toString());
983+
toast.success("Task URL copied to clipboard");
984+
}}
985+
style={{
986+
backgroundColor: "#2563EB",
987+
color: "white",
988+
padding: "6px 16px",
989+
fontSize: "14px",
990+
borderRadius: "4px",
991+
border: "none",
992+
minWidth: "auto",
993+
width: "auto",
994+
}}
995+
>
996+
Copy URL
997+
</Button>
998+
971999
{/* VIEWING MODE: Show Close when just viewing (no changes) */}
9721000
{!hasUnsavedChanges && (
9731001
<Button

0 commit comments

Comments
 (0)