style: playground button tips

This commit is contained in:
jialin
2024-07-24 18:21:51 +08:00
parent 729f7785f0
commit 14be606ac9
7 changed files with 52 additions and 32 deletions
+21 -19
View File
@@ -1,6 +1,6 @@
import { CheckCircleFilled, CopyOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button, message } from 'antd';
import { Button, Tooltip, message } from 'antd';
import ClipboardJS from 'clipboard';
import { useEffect, useRef, useState } from 'react';
@@ -55,24 +55,26 @@ const CopyButton: React.FC<CopyButtonProps> = ({
}, [buttonRef]);
return (
<Button
className="copy-button"
ref={buttonRef}
type={type}
shape={shape}
size={size}
disabled={!!disabled}
data-clipboard-text={text}
icon={
copied ? (
<CheckCircleFilled
style={{ color: 'var(--ant-color-success)', fontSize: fontSize }}
/>
) : (
<CopyOutlined style={{ fontSize: fontSize, ...style }} />
)
}
></Button>
<Tooltip title={intl.formatMessage({ id: 'common.button.copy' })}>
<Button
className="copy-button"
ref={buttonRef}
type={type}
shape={shape}
size={size}
disabled={!!disabled}
data-clipboard-text={text}
icon={
copied ? (
<CheckCircleFilled
style={{ color: 'var(--ant-color-success)', fontSize: fontSize }}
/>
) : (
<CopyOutlined style={{ fontSize: fontSize, ...style }} />
)
}
></Button>
</Tooltip>
);
};
+1 -1
View File
@@ -1,7 +1,7 @@
import { createFromIconfontCN } from '@ant-design/icons';
const IconFont = createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/c/font_4613488_nw3caxx03yp.js'
scriptUrl: '//at.alicdn.com/t/c/font_4613488_68kh94h3e2r.js'
});
export default IconFont;