File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 11import React , { CSSProperties , ReactNode } from 'react' ;
2- import { CopyOutlined } from '@ant-design/icons' ;
32import { message , Tooltip } from 'antd' ;
43import classNames from 'classnames' ;
54import useClippy from 'use-clippy' ;
@@ -16,9 +15,25 @@ export interface ICopyProps {
1615 onCopy ?: ( text : string ) => void ;
1716}
1817
18+ // 后续迁移了 icon 库之后,可以直接从 icon 中引入
19+ const CopyIcon = ( ) => (
20+ < span className = "dtc-copy__default-icon" >
21+ < svg
22+ viewBox = "0 0 1024 1024"
23+ version = "1.1"
24+ xmlns = "http://www.w3.org/2000/svg"
25+ width = "1em"
26+ height = "1em"
27+ fill = "currentColor"
28+ >
29+ < path d = "M704 96a96 96 0 0 1 96 96v16h32a96 96 0 0 1 96 96v512a96 96 0 0 1-96 96H320a96 96 0 0 1-96-96v-16h-32a96 96 0 0 1-95.936-92.4L96 704V192a96 96 0 0 1 96-96z m96 608a96 96 0 0 1-96 96H288v16a32 32 0 0 0 32 32h512a32 32 0 0 0 32-32V304a32 32 0 0 0-32-32h-32z m-96-544H192a32 32 0 0 0-32 32v512a32 32 0 0 0 32 32h512a32 32 0 0 0 32-32V192a32 32 0 0 0-32-32z m-256 64a32 32 0 0 1 32 32v160h160a32 32 0 1 1 0 64H480v160a32 32 0 1 1-64 0V480H256a32 32 0 1 1 0-64h160V256a32 32 0 0 1 32-32z" > </ path >
30+ </ svg >
31+ </ span >
32+ ) ;
33+
1934const Copy : React . FC < ICopyProps > = ( props ) => {
2035 const {
21- button = < CopyOutlined className = "dtc-copy__default-icon" /> ,
36+ button = < CopyIcon /> ,
2237 text,
2338 tooltip = '复制' ,
2439 style,
Original file line number Diff line number Diff line change 11.dtc-copy {
22 display : inline-block ;
33 cursor : pointer ;
4- & __default-icon :hover {
5- color : #58ABF9 ;
4+ & __default-icon {
5+ color : #1D78FF ;
66 }
77}
You can’t perform that action at this time.
0 commit comments