Skip to content

Commit

Permalink
display token contract address (#514)
Browse files Browse the repository at this point in the history
* display token contract address

* come back to 1.0.2
  • Loading branch information
fleandrei authored Feb 6, 2025
1 parent 6eab8e6 commit a6b3b37
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/Token/Token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Button } from '../Button';
import { Tooltip } from '../Tooltip';
import { DollarValue } from '../DollarValue';
import { formatAmount } from '../../lib/util/parseAmount';
import { maskAddress } from '../../lib/massa-react/utils/index';
import { Clipboard } from '../Clipboard';

export interface TokenProps extends ComponentPropsWithoutRef<'div'> {
logo?: React.ReactNode;
Expand All @@ -17,6 +19,7 @@ export interface TokenProps extends ComponentPropsWithoutRef<'div'> {
dollarValue?: string;
dollarValueError?: React.ReactNode;
customClass?: string;
address?: string;
disable?: boolean;
onDelete?: () => void;
}
Expand All @@ -31,6 +34,7 @@ export function Token(props: TokenProps) {
dollarValue,
dollarValueError,
customClass = '',
address,
disable,
onDelete,
...rest
Expand Down Expand Up @@ -75,7 +79,13 @@ export function Token(props: TokenProps) {
</div>
</div>
</div>
<div>
<div className="flex items-center gap-2">
{address && (
<Clipboard
rawContent={address}
displayedContent={maskAddress(address)}
/>
)}
{disable ? null : (
<Button variant="icon" onClick={onDelete}>
<FiTrash2 size={24} />
Expand Down

0 comments on commit a6b3b37

Please sign in to comment.