From b50bde615865b4de30a28a2c98c9a8a07dd71e93 Mon Sep 17 00:00:00 2001 From: mit-27 Date: Mon, 27 May 2024 21:57:50 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20bugs=20and=20added=20copy?= =?UTF-8?q?=20feat=20for=20linkedUserId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Configuration/LinkedUsers/columns.tsx | 42 +++++++++++++++---- .../src/components/Nav/main-nav-sm.tsx | 13 ------ .../react/src/components/Modal.tsx | 5 +-- .../src/components/PanoraDynamicCatalog.tsx | 1 - .../react/src/hooks/useOAuth.tsx | 24 ++++++----- 5 files changed, 50 insertions(+), 35 deletions(-) diff --git a/apps/client-ts/src/components/Configuration/LinkedUsers/columns.tsx b/apps/client-ts/src/components/Configuration/LinkedUsers/columns.tsx index 36528c49d..0cf0c83e7 100644 --- a/apps/client-ts/src/components/Configuration/LinkedUsers/columns.tsx +++ b/apps/client-ts/src/components/Configuration/LinkedUsers/columns.tsx @@ -2,6 +2,40 @@ import { ColumnDef } from "@tanstack/react-table"; import { ColumnLU } from "./schema"; import { DataTableColumnHeader } from "@/components/shared/data-table-column-header"; import { Badge } from "@/components/ui/badge"; +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; +import { toast } from "sonner"; + + +const LinkedUserIdComponent = ({ row } : {row:any}) => { + + const handleCopyLinkedUserId = () => { + navigator.clipboard.writeText(row.getValue("linked_user_id")); + toast.success("LinkedUser ID copied!", { + action: { + label: "Close", + onClick: () => console.log("Close"), + }, + }) + }; + + return ( +
+ + + + + {row.getValue("linked_user_id")} + + + +

Copy

+
+
+
+
+ ) +} + export const columns: ColumnDef[] = [ { @@ -9,13 +43,7 @@ export const columns: ColumnDef[] = [ header: ({ column }) => ( ), - cell: ({ row }) =>{ - return ( -
- {row.getValue("linked_user_id")} -
- ) - }, + cell: LinkedUserIdComponent, enableSorting: false, enableHiding: false, }, diff --git a/apps/client-ts/src/components/Nav/main-nav-sm.tsx b/apps/client-ts/src/components/Nav/main-nav-sm.tsx index 9c643738a..390c13f94 100644 --- a/apps/client-ts/src/components/Nav/main-nav-sm.tsx +++ b/apps/client-ts/src/components/Nav/main-nav-sm.tsx @@ -61,7 +61,6 @@ export function SmallNav({ setOpen(false)}> - {/* Panora. */} {theme == "light" ? : } @@ -70,18 +69,6 @@ export function SmallNav({