mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
Merge pull request #15170 from Hazyzh/modify_doc_icon_bg
(Site_Icon_Display) modify background color for two tone icon item
This commit is contained in:
commit
5da728117c
@ -46,6 +46,10 @@ ul.anticons-list {
|
||||
}
|
||||
}
|
||||
|
||||
&.outlined:hover {
|
||||
background-color: #8ecafe;
|
||||
}
|
||||
|
||||
&.copied:hover {
|
||||
color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import CopyToClipboard from 'react-copy-to-clipboard';
|
||||
import { Icon as AntdIcon, Badge } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import { ThemeType, IconProps } from '../../../../components/icon';
|
||||
|
||||
const Icon: React.SFC<IconProps> = AntdIcon;
|
||||
@ -20,6 +21,10 @@ const CopyableIcon: React.SFC<CopyableIconProps> = ({
|
||||
justCopied,
|
||||
onCopied,
|
||||
}) => {
|
||||
const className = classNames({
|
||||
copied: justCopied === type,
|
||||
outlined: theme === 'twoTone',
|
||||
});
|
||||
return (
|
||||
<CopyToClipboard
|
||||
text={
|
||||
@ -29,7 +34,7 @@ const CopyableIcon: React.SFC<CopyableIconProps> = ({
|
||||
}
|
||||
onCopy={(text: string) => onCopied(type, text)}
|
||||
>
|
||||
<li className={justCopied === type ? 'copied' : ''}>
|
||||
<li className={className}>
|
||||
<Icon type={type} theme={theme} />
|
||||
<span className="anticon-class">
|
||||
<Badge dot={isNew}>{type}</Badge>
|
||||
|
Loading…
Reference in New Issue
Block a user