mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-29 18:50:00 +08:00
docs: remove duplicated icon from document
This commit is contained in:
parent
9e104292a2
commit
16c0ca9100
@ -166,6 +166,7 @@
|
||||
"@types/raf": "^3.4.0",
|
||||
"@types/react": "^16.9.21",
|
||||
"@types/react-color": "^3.0.1",
|
||||
"@types/react-copy-to-clipboard": "^4.3.0",
|
||||
"@types/react-dom": "^16.9.5",
|
||||
"@types/warning": "^3.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^3.0.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import CopyToClipboard from 'react-copy-to-clipboard';
|
||||
import { Badge } from 'antd';
|
||||
import { Badge, message } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import * as AntdIcons from '@ant-design/icons';
|
||||
import { ThemeType } from './index';
|
||||
@ -28,8 +28,15 @@ const CopyableIcon: React.FC<CopyableIconProps> = ({
|
||||
copied: justCopied === name,
|
||||
[theme]: !!theme,
|
||||
});
|
||||
const onCopy = (text: string, result: boolean) => {
|
||||
if (result) {
|
||||
onCopied(name, text);
|
||||
} else {
|
||||
message.error('Copy icon name failed, please try again.');
|
||||
}
|
||||
};
|
||||
return (
|
||||
<CopyToClipboard text={`<${name} />`} onCopy={(text: string) => onCopied(name, text)}>
|
||||
<CopyToClipboard text={`<${name} />`} onCopy={onCopy}>
|
||||
<li className={className}>
|
||||
{React.createElement(allIcons[name])}
|
||||
<span className="anticon-class">
|
||||
|
@ -68,6 +68,9 @@ class IconDisplay extends React.PureComponent<IconDisplayProps, IconDisplayState
|
||||
);
|
||||
}
|
||||
|
||||
// CopyrightCircle is same as Copyright, don't show it
|
||||
iconList = iconList.filter(icon => icon !== 'CopyrightCircle');
|
||||
|
||||
return {
|
||||
category: key,
|
||||
icons: iconList.map(iconName => iconName + theme).filter(iconName => allIcons[iconName]),
|
||||
|
2
typings/custom-typings.d.ts
vendored
2
typings/custom-typings.d.ts
vendored
@ -65,5 +65,3 @@ declare module '*.json' {
|
||||
export const version: string;
|
||||
export default value;
|
||||
}
|
||||
|
||||
declare module 'react-copy-to-clipboard';
|
||||
|
Loading…
Reference in New Issue
Block a user