Skip to content

Commit

Permalink
✨ style: added tooltip text for external link (ant-design#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
maifeeulasad committed Dec 1, 2024
1 parent 6f01cc9 commit 74eecb4
Showing 1 changed file with 10 additions and 41 deletions.
51 changes: 10 additions & 41 deletions src/ChatItem/components/MessageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Flexbox } from 'react-layout-kit';

import { ChatItemProps } from '@/ChatItem';
import EditableMessage from '@/EditableMessage';
import { Card, ConfigProvider, List } from 'antd';
import { Card, ConfigProvider, List, Tooltip } from 'antd';

import { MarkdownProps } from '@ant-design/pro-editor';
import { useStyles } from '../style';
Expand All @@ -21,13 +21,15 @@ const ExternalLink: React.FC<ExternalLinkProps> = ({ url }) => {
};

return (
<InfoCircleOutlined
style={{
cursor: 'pointer',
transition: 'color 0.3s ease',
}}
onClick={handleClick}
/>
<Tooltip title={`Open in new tab: ${url}`}>
<InfoCircleOutlined
style={{
cursor: 'pointer',
transition: 'color 0.3s ease',
}}
onClick={handleClick}
/>
</Tooltip>
);
};

Expand Down Expand Up @@ -67,39 +69,6 @@ const MessageContent = memo<MessageContentProps>(
}) => {
const { cx, styles } = useStyles({ editing, placement, primary, type });
const { mobile } = useResponsive();
// const references = [
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'a' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'bc' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'bd' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'bb' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'bb' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'bb' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'bb' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'bb' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'bb' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// { url: 'https://www.a.com', description: 'lots of meawww', title: 'bb' },
// { url: 'https://www.b.com', title: 'bb' },
// { url: 'http://woof.com', description: 'ghew ghew', title: 'dog' },
// ];

const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixClass = getPrefixCls('pro-chat');

Expand Down

0 comments on commit 74eecb4

Please sign in to comment.