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:
偏右 2019-03-04 22:26:50 +08:00 committed by GitHub
commit 5da728117c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -46,6 +46,10 @@ ul.anticons-list {
}
}
&.outlined:hover {
background-color: #8ecafe;
}
&.copied:hover {
color: rgba(255, 255, 255, 0.2);
}

View File

@ -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>