You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1000 B

feat: Float Button (#37520) * feat: add FloatButton * feat: add FloatButton * feat: FloatButton * feat: FloatButton * fix: fix * feat: FloatButton * feat: FloatButton * feat: FloatButton * feat: FloatButton * feat: FloatButton * fix: add groupShape * feat: mergeShape * fix: fix * fix: fix style * fix: style fix * fix: fix * fix: style fix * fix: fix * fix: fix * fix: fix * fix: fix style * fix: fix style * fix: fix style * fix: style fix * feat: back-top * fix: style bug fix * fix: fix erroe * fix: add tiggerElement * fix: add tiggerElement * fix: add tiggerElement * fix: add tiggerElement * feat: add useMemo * docs: add docs * fix: bugFix * fix: bugFix * fix: bugfix * fix: style fix * fix: bugfix * test: add test case * fix: style fix * fix: style fix * fix: fix style * fix: fix style * fix: fix trigger action * fix: fix style * feat: add demo * fix: add demo * feat: add docs * fix: style ifx * feat: update maxSize of bundlesize * feat: add animation for group * fix: fix * fix: fix style * fix: fix test case * fix: fix test case * fix: fix type * fix: fix type * fix: update bundlesize * fix: fix * fix: fix style * fix: fix style * fix: updata snap * fix: fix CI * fix: fix style * fix: rename float button motion * fix: fix style * fix: bugFix * fix: fix style * fix: bugFix * fix: update docs * refactor: float button trigger * test: fix test case & update snapshot * fix: delete rest * docs: update demo * test: update snapshot * fix: fix eslint error * test: update snapshot * style: update icon fontSize to 18 * fix: fix style * fix: style fix * fix: test case fix * test: add test case * fix: style fix * test: update snap * fix: style fix * fix: style fix * fix: style fix * docs: demo update * fix: style fix * docs: update demo * test: update snapshot Co-authored-by: 黑雨 <wangning4567@163.com> Co-authored-by: MadCcc <1075746765@qq.com>
2 years ago
import React, { memo } from 'react';
import FileTextOutlined from '@ant-design/icons/FileTextOutlined';
import classNames from 'classnames';
import type { FloatButtonContentProps } from './interface';
const FloatButtonContent: React.FC<FloatButtonContentProps> = (props) => {
feat: Float Button (#37520) * feat: add FloatButton * feat: add FloatButton * feat: FloatButton * feat: FloatButton * fix: fix * feat: FloatButton * feat: FloatButton * feat: FloatButton * feat: FloatButton * feat: FloatButton * fix: add groupShape * feat: mergeShape * fix: fix * fix: fix style * fix: style fix * fix: fix * fix: style fix * fix: fix * fix: fix * fix: fix * fix: fix style * fix: fix style * fix: fix style * fix: style fix * feat: back-top * fix: style bug fix * fix: fix erroe * fix: add tiggerElement * fix: add tiggerElement * fix: add tiggerElement * fix: add tiggerElement * feat: add useMemo * docs: add docs * fix: bugFix * fix: bugFix * fix: bugfix * fix: style fix * fix: bugfix * test: add test case * fix: style fix * fix: style fix * fix: fix style * fix: fix style * fix: fix trigger action * fix: fix style * feat: add demo * fix: add demo * feat: add docs * fix: style ifx * feat: update maxSize of bundlesize * feat: add animation for group * fix: fix * fix: fix style * fix: fix test case * fix: fix test case * fix: fix type * fix: fix type * fix: update bundlesize * fix: fix * fix: fix style * fix: fix style * fix: updata snap * fix: fix CI * fix: fix style * fix: rename float button motion * fix: fix style * fix: bugFix * fix: fix style * fix: bugFix * fix: update docs * refactor: float button trigger * test: fix test case &amp; update snapshot * fix: delete rest * docs: update demo * test: update snapshot * fix: fix eslint error * test: update snapshot * style: update icon fontSize to 18 * fix: fix style * fix: style fix * fix: test case fix * test: add test case * fix: style fix * test: update snap * fix: style fix * fix: style fix * fix: style fix * docs: demo update * fix: style fix * docs: update demo * test: update snapshot Co-authored-by: 黑雨 &lt;wangning4567@163.com&gt; Co-authored-by: MadCcc &lt;1075746765@qq.com&gt;
2 years ago
const { icon, description, prefixCls, className } = props;
const defaultElement = (
<div className={`${prefixCls}-icon`}>
<FileTextOutlined />
</div>
);
return (
<div
onClick={props.onClick}
onFocus={props.onFocus}
onMouseEnter={props.onMouseEnter}
onMouseLeave={props.onMouseLeave}
className={classNames(className, `${prefixCls}-content`)}
>
{icon || description ? (
<>
{icon && <div className={`${prefixCls}-icon`}>{icon}</div>}
{description && <div className={`${prefixCls}-description`}>{description}</div>}
</>
) : (
defaultElement
)}
</div>
);
};
export default memo(FloatButtonContent);