refactor: 移动部分组件到组件库中

pull/81/head
moonrailgun 3 years ago
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';

@ -1,3 +1,5 @@
export { DelayTip } from './DelayTip';
export { Highlight } from './Highlight';
export { Icon } from './Icon';
export { Image } from './Image';

@ -0,0 +1 @@
declare module '*.module.less';

@ -1,14 +1 @@
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';
export { DelayTip } from 'tailchat-design';

@ -1,10 +1 @@
import React from 'react';
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';
export { Highlight } from 'tailchat-design';

Loading…
Cancel
Save