mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
fix: classNames typing errors (#30018)
This commit is contained in:
parent
dda9f61458
commit
13a829d20c
@ -261,7 +261,7 @@ class Affix extends React.Component<AffixProps, AffixState> {
|
||||
const { affixStyle, placeholderStyle } = this.state;
|
||||
const { prefixCls, children } = this.props;
|
||||
const className = classNames({
|
||||
[getPrefixCls('affix', prefixCls)]: affixStyle,
|
||||
[getPrefixCls('affix', prefixCls)]: !!affixStyle,
|
||||
});
|
||||
|
||||
let props = omit(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target', 'onChange']);
|
||||
|
@ -9,7 +9,7 @@ import useBreakpoint from '../grid/hooks/useBreakpoint';
|
||||
import SizeContext, { AvatarSize } from './SizeContext';
|
||||
|
||||
export interface AvatarProps {
|
||||
/** Shape of avatar, options:`circle`, `square` */
|
||||
/** Shape of avatar, options: `circle`, `square` */
|
||||
shape?: 'circle' | 'square';
|
||||
/*
|
||||
* Size of avatar, options: `large`, `small`, `default`
|
||||
@ -138,9 +138,9 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
|
||||
prefixCls,
|
||||
sizeCls,
|
||||
{
|
||||
[`${prefixCls}-${shape}`]: shape,
|
||||
[`${prefixCls}-${shape}`]: !!shape,
|
||||
[`${prefixCls}-image`]: hasImageElement || (src && isImgExist),
|
||||
[`${prefixCls}-icon`]: icon,
|
||||
[`${prefixCls}-icon`]: !!icon,
|
||||
},
|
||||
className,
|
||||
);
|
||||
|
@ -237,7 +237,7 @@ const InternalButton: React.ForwardRefRenderFunction<unknown, ButtonProps> = (pr
|
||||
[`${prefixCls}-${type}`]: type,
|
||||
[`${prefixCls}-${shape}`]: shape,
|
||||
[`${prefixCls}-${sizeCls}`]: sizeCls,
|
||||
[`${prefixCls}-icon-only`]: !children && children !== 0 && iconType,
|
||||
[`${prefixCls}-icon-only`]: !children && children !== 0 && !!iconType,
|
||||
[`${prefixCls}-background-ghost`]: ghost && !isUnborderedButtonType(type),
|
||||
[`${prefixCls}-loading`]: innerLoading,
|
||||
[`${prefixCls}-two-chinese-chars`]: hasTwoCNChar && autoInsertSpace,
|
||||
|
@ -188,7 +188,7 @@ function FormItem<Values = any>(props: FormItemProps<Values>): React.ReactElemen
|
||||
|
||||
const itemClassName = {
|
||||
[`${prefixCls}-item`]: true,
|
||||
[`${prefixCls}-item-with-help`]: domErrorVisible || help,
|
||||
[`${prefixCls}-item-with-help`]: domErrorVisible || !!help,
|
||||
[`${className}`]: !!className,
|
||||
|
||||
// Status
|
||||
|
@ -174,7 +174,7 @@ function List<T>({
|
||||
[`${prefixCls}-split`]: split,
|
||||
[`${prefixCls}-bordered`]: bordered,
|
||||
[`${prefixCls}-loading`]: isLoading,
|
||||
[`${prefixCls}-grid`]: grid,
|
||||
[`${prefixCls}-grid`]: !!grid,
|
||||
[`${prefixCls}-something-after-last-item`]: isSomethingAfterLastItem(),
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
},
|
||||
|
@ -161,8 +161,8 @@ const PageHeader: React.FC<PageHeaderProps> = props => {
|
||||
breadcrumbRender?.(props, defaultBreadcrumbDom) || defaultBreadcrumbDom;
|
||||
|
||||
const className = classNames(prefixCls, customizeClassName, {
|
||||
'has-breadcrumb': breadcrumbDom,
|
||||
'has-footer': footer,
|
||||
'has-breadcrumb': !!breadcrumbDom,
|
||||
'has-footer': !!footer,
|
||||
[`${prefixCls}-ghost`]: ghost,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
[`${prefixCls}-compact`]: compact,
|
||||
|
@ -157,7 +157,7 @@ function injectSorter<RecordType>(
|
||||
<span>{renderColumnTitle(column.title, renderProps)}</span>
|
||||
<span
|
||||
className={classNames(`${prefixCls}-column-sorter`, {
|
||||
[`${prefixCls}-column-sorter-full`]: upNode && downNode,
|
||||
[`${prefixCls}-column-sorter-full`]: !!(upNode && downNode),
|
||||
})}
|
||||
>
|
||||
<span className={`${prefixCls}-column-sorter-inner`}>
|
||||
|
@ -43,7 +43,7 @@ const TimelineItem: React.FC<TimelineItemProps> = ({
|
||||
|
||||
const dotClassName = classNames({
|
||||
[`${prefixCls}-item-head`]: true,
|
||||
[`${prefixCls}-item-head-custom`]: dot,
|
||||
[`${prefixCls}-item-head-custom`]: !!dot,
|
||||
[`${prefixCls}-item-head-${color}`]: true,
|
||||
});
|
||||
|
||||
|
@ -320,8 +320,8 @@ export default class TransferList<
|
||||
const footerDom = footer && footer(this.props);
|
||||
|
||||
const listCls = classNames(prefixCls, {
|
||||
[`${prefixCls}-with-pagination`]: pagination,
|
||||
[`${prefixCls}-with-footer`]: footerDom,
|
||||
[`${prefixCls}-with-pagination`]: !!pagination,
|
||||
[`${prefixCls}-with-footer`]: !!footerDom,
|
||||
});
|
||||
|
||||
// ====================== Get filtered, checked item list ======================
|
||||
|
Loading…
Reference in New Issue
Block a user