Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support tooltip #97

Merged
merged 7 commits into from
Nov 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions packages/web3/src/connect-button/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tooltip } from 'antd';
import { Tooltip, message } from 'antd';
import { CopyOutlined } from '@ant-design/icons';
import type { ConnectButtonTooltipProps } from './interface';
import type { PropsWithChildren } from 'react';
Expand All @@ -12,7 +12,15 @@ export const ConnectButtonTooltip: React.FC<PropsWithChildren<ConnectButtonToolt
if (!title) return null;
const content = copyable ? (
<>
{title} <CopyOutlined />
{title}{' '}
kiner-tang marked this conversation as resolved.
Show resolved Hide resolved
<CopyOutlined
title="Copy Address"
onClick={() => {
navigator.clipboard.writeText(String(title)).then(() => {
message.success('Address Copied!');
kiner-tang marked this conversation as resolved.
Show resolved Hide resolved
});
}}
/>
</>
) : (
title
Expand Down