mirror of https://github.com/msgbyte/tailchat
refactor: 移动部分组件到组件库中
parent
d38b912d4d
commit
e883988d68
@ -0,0 +1,14 @@
|
|||||||
|
import { Tooltip, TooltipProps } from 'antd';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 延时提示
|
||||||
|
*/
|
||||||
|
export const DelayTip: React.FC<TooltipProps> = React.memo((props) => {
|
||||||
|
return (
|
||||||
|
<Tooltip mouseEnterDelay={1} {...props}>
|
||||||
|
{props.children}
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
DelayTip.displayName = 'DelayTip';
|
@ -0,0 +1,8 @@
|
|||||||
|
.highLight {
|
||||||
|
background-color: rgba(0,0,0,0.2);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding-top: 0.25rem;
|
||||||
|
padding-bottom: 0.25rem;
|
||||||
|
padding-left: 0.5rem;
|
||||||
|
padding-right: 0.5rem;
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styles from './index.module.less';
|
||||||
|
|
||||||
|
export const Highlight: React.FC = React.memo((props) => {
|
||||||
|
return <span className={styles.highLight}>{props.children}</span>;
|
||||||
|
});
|
||||||
|
Highlight.displayName = 'Highlight';
|
@ -0,0 +1 @@
|
|||||||
|
declare module '*.module.less';
|
@ -1,14 +1 @@
|
|||||||
import { Tooltip, TooltipProps } from 'antd';
|
export { DelayTip } from 'tailchat-design';
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 延时提示
|
|
||||||
*/
|
|
||||||
export const DelayTip: React.FC<TooltipProps> = React.memo((props) => {
|
|
||||||
return (
|
|
||||||
<Tooltip mouseEnterDelay={1} {...props}>
|
|
||||||
{props.children}
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
DelayTip.displayName = 'DelayTip';
|
|
||||||
|
@ -1,10 +1 @@
|
|||||||
import React from 'react';
|
export { Highlight } from 'tailchat-design';
|
||||||
|
|
||||||
export const Highlight: React.FC = React.memo((props) => {
|
|
||||||
return (
|
|
||||||
<span className="bg-black bg-opacity-20 rounded py-1 px-2">
|
|
||||||
{props.children}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
Highlight.displayName = 'Highlight';
|
|
||||||
|
Loading…
Reference in New Issue