diff --git a/src/components/CopyBox.tsx b/src/components/CopyBox.tsx
index 204ab1a..52605dd 100644
--- a/src/components/CopyBox.tsx
+++ b/src/components/CopyBox.tsx
@@ -1,22 +1,10 @@
-import { writeText } from '@tauri-apps/plugin-clipboard-manager';
-import { CopyCheckIcon, CopyIcon } from 'lucide-react';
-import { useState } from 'react';
-import { Button } from './ui/button';
+import { CopyButton } from './CopyButton';
export function CopyBox(props: {
title: string;
content: string;
className?: string;
}) {
- const [copied, setCopied] = useState(false);
-
- const copyAddress = () => {
- writeText(props.content);
-
- setCopied(true);
- setTimeout(() => setCopied(false), 2000);
- };
-
return (
-
+ />
);
}
diff --git a/src/components/CopyButton.tsx b/src/components/CopyButton.tsx
new file mode 100644
index 0000000..b81d071
--- /dev/null
+++ b/src/components/CopyButton.tsx
@@ -0,0 +1,30 @@
+import { writeText } from '@tauri-apps/plugin-clipboard-manager';
+import { CopyCheckIcon, CopyIcon } from 'lucide-react';
+import { useState } from 'react';
+import { Button } from './ui/button';
+
+export function CopyButton(props: { value: string; className?: string }) {
+ const [copied, setCopied] = useState(false);
+
+ const copyAddress = () => {
+ writeText(props.value);
+
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ };
+
+ return (
+
+ );
+}
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
index a93fda5..31a5afc 100644
--- a/src/components/Header.tsx
+++ b/src/components/Header.tsx
@@ -11,7 +11,7 @@ import { Sheet, SheetContent, SheetTrigger } from './ui/sheet';
export default function Header(
props: PropsWithChildren<{
- title: string;
+ title: string | ReactNode;
back?: () => void;
children?: ReactNode;
}>,
diff --git a/src/pages/Token.tsx b/src/pages/Token.tsx
index 95ab33e..6f634b1 100644
--- a/src/pages/Token.tsx
+++ b/src/pages/Token.tsx
@@ -1,7 +1,6 @@
import CoinList from '@/components/CoinList';
import ConfirmationDialog from '@/components/ConfirmationDialog';
import Container from '@/components/Container';
-import { CopyBox } from '@/components/CopyBox';
import Header from '@/components/Header';
import { ReceiveAddress } from '@/components/ReceiveAddress';
import { Button } from '@/components/ui/button';
@@ -53,6 +52,7 @@ import {
events,
TransactionSummary,
} from '../bindings';
+import { CopyButton } from '@/components/CopyButton';
export default function Token() {
const navigate = useNavigate();
@@ -174,13 +174,18 @@ export default function Token() {
return (
<>
-
+
+ {asset ? (asset.name ?? 'Unknown asset') : ''}{' '}
+ {asset?.asset_id !== 'xch' && (
+
+ )}
+
+ }
+ />
- {asset?.asset_id !== 'xch' && (
-
- )}
-