From 52b6a1556ee4dc7aeebb671337df0ced8b8e4d00 Mon Sep 17 00:00:00 2001 From: Nicolas Brugneaux Date: Fri, 29 Nov 2024 17:08:23 +0100 Subject: [PATCH 01/24] fix: copy address instead of shortenaddress or group --- src/components/charts/chartData.ts | 1 + src/components/text/CopyInline.tsx | 5 +++-- src/components/text/ShortAddress.tsx | 11 +++++++++-- .../delegation/components/DelegatorsTable.tsx | 4 +++- .../governance/components/ProposalVotersTable.tsx | 11 ++++++++--- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/components/charts/chartData.ts b/src/components/charts/chartData.ts index 01a3e09..ebc9a3c 100644 --- a/src/components/charts/chartData.ts +++ b/src/components/charts/chartData.ts @@ -5,6 +5,7 @@ export interface ChartDataItem { label: string; value: number; percentage?: number; + address?: `0x${string}`; } export function sortAndCombineChartData( diff --git a/src/components/text/CopyInline.tsx b/src/components/text/CopyInline.tsx index 74e03aa..63857ef 100644 --- a/src/components/text/CopyInline.tsx +++ b/src/components/text/CopyInline.tsx @@ -3,10 +3,11 @@ import { useCopyHandler } from 'src/utils/clipboard'; type Props = ButtonHTMLAttributes & { text: string; + textToCopy?: string; }; -export function CopyInline({ text, ...props }: Props) { - const onClick = useCopyHandler(text); +export function CopyInline({ text, textToCopy = text, ...props }: Props) { + const onClick = useCopyHandler(textToCopy); return (