ant-design/components/icon/index.tsx
Andrey G a307a7acf7 refactor: remove unnecessary computed props for classNames (#4055)
* remove unnecessary computed props for classNames

* rollback autocomplete optimization for possible css style order issue

* update snapshots

* remove more unnecessary computed props at Input
2016-11-30 10:20:23 +08:00

23 lines
594 B
TypeScript
Executable File

import * as React from 'react';
import classNames from 'classnames';
import omit from 'omit.js';
export interface IconProps {
type: string;
className?: string;
title?: string;
onClick?: React.MouseEventHandler<any>;
spin?: boolean;
style?: React.CSSProperties;
}
export default (props: IconProps) => {
const { type, className = '', spin } = props;
const classString = classNames({
anticon: true,
'anticon-spin': !!spin || type === 'loading',
[`anticon-${type}`]: true,
}, className);
return <i {...omit(props, ['type', 'spin'])} className={classString} />;
};