Skip to content

Commit

Permalink
display token contract address
Browse files Browse the repository at this point in the history
  • Loading branch information
fleandrei committed Feb 6, 2025
1 parent ccfd709 commit ce917de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@massalabs/react-ui-kit",
"version": "1.0.2",
"version": "1.0.3",
"type": "module",
"files": ["src", "presets"],
"main": "src/index.ts",
Expand Down
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 ce917de

Please sign in to comment.