diff --git a/apps/namadillo/src/App/Transfer/TransferSource.tsx b/apps/namadillo/src/App/Transfer/TransferSource.tsx index e52ef11abc..1e5ef1ce77 100644 --- a/apps/namadillo/src/App/Transfer/TransferSource.tsx +++ b/apps/namadillo/src/App/Transfer/TransferSource.tsx @@ -1,8 +1,11 @@ import { Asset } from "@chain-registry/types"; import { AmountInput, Tooltip } from "@namada/components"; +import { copyToClipboard, shortenAddress } from "@namada/utils"; import BigNumber from "bignumber.js"; import clsx from "clsx"; import { wallets } from "integrations"; +import { useState } from "react"; +import { GoCheck } from "react-icons/go"; import { Address } from "types"; import namadaShieldedIcon from "./assets/namada-shielded.svg"; import namadaTransparentIcon from "./assets/namada-transparent.svg"; @@ -80,11 +83,21 @@ export const TransferSource = ({ openAssetSelector, onChangeAmount, }: TransferSourceProps): JSX.Element => { + const [isCopied, setIsCopied] = useState(false); + const selectedTokenType = isTransparentAddress(sourceAddress ?? "") ? "transparent" : isShieldedAddress(sourceAddress ?? "") ? "shielded" : "keplr"; + const handleCopyAddress = (): void => { + if (sourceAddress) { + copyToClipboard(sourceAddress); + setIsCopied(true); + setTimeout(() => setIsCopied(false), 500); + } + }; + return (