From d1c5b5b366a18061317ed7b4a5b9a4fbbe3e9b40 Mon Sep 17 00:00:00 2001
From: BenRey
Date: Fri, 11 Oct 2024 10:55:06 +0200
Subject: [PATCH] feat: enhance ScheduleTable with improved address display and
centralized token info retrieval
---
front/src/components/ScheduleTable.tsx | 64 ++++++++++++++------------
front/src/store/store.ts | 10 +---
front/src/utils/assets.ts | 21 +++++++++
3 files changed, 57 insertions(+), 38 deletions(-)
create mode 100644 front/src/utils/assets.ts
diff --git a/front/src/components/ScheduleTable.tsx b/front/src/components/ScheduleTable.tsx
index afaedab..95a375a 100644
--- a/front/src/components/ScheduleTable.tsx
+++ b/front/src/components/ScheduleTable.tsx
@@ -6,15 +6,17 @@ import CheckBox from './CheckBox';
import useSchedule from '@/services/useSchedule';
import { MasToken, supportedTokens } from '../const/assets';
import ScheduleHistory from '@/components/ScheduleHistory';
+import { getTokenInfo } from '@/utils/assets';
interface ScheduleTableProps {
schedules: Schedule[];
}
-const CopyableAddress: React.FC<{ address: string; label: string }> = ({
- address,
- label,
-}) => (
+const CopyableAddress: React.FC<{
+ address: string;
+ label: string;
+ value: string;
+}> = ({ value, address, label }) => (
= ({
toast.success(`${label} copied to clipboard`);
}}
>
- {truncateAddress(address)}
+ {value}
);
@@ -47,7 +49,7 @@ const TableHeader: React.FC = () => (
].map((header, index) => (