,
) => VNode;
}
+
+export const CopyIcon = (): VNode => (
+
+
+
+
+);
+
+export const CopiedIcon = (): VNode => (
+
+
+
+);
+
+function CopyButton({ getContent }: { getContent: () => string }): VNode {
+ const [copied, setCopied] = useState(false);
+ function copyText(): void {
+ navigator.clipboard.writeText(getContent() || "");
+ setCopied(true);
+ }
+ useEffect(() => {
+ if (copied) {
+ setTimeout(() => {
+ setCopied(false);
+ }, 1000);
+ }
+ }, [copied]);
+
+ if (!copied) {
+ return (
+
+
+
+ );
+ }
+ return (
+
+
+
+
+
+ );
+}
+
+
/**
* Query account information and show QR code if there is pending withdrawal
*/
@@ -66,7 +121,6 @@ export function AccountPage({ account, onLoadNotOk }: Props): VNode {
Payto from server is not valid "{data.paytoUri}"
);
}
- const accountNumber = payto.iban;
const balanceIsDebit = data.balance.credit_debit_indicator == "debit";
const limit = balanceIsDebit
? Amounts.sub(debitThreshold, balance).amount
@@ -76,8 +130,7 @@ export function AccountPage({ account, onLoadNotOk }: Props): VNode {
- Welcome, {accountNumber ? `${account} (${accountNumber})` : account}
- !
+ Welcome, {account} ({payto.iban} )! stringifyPaytoUri(payto)} />