mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-11 10:05:07 +08:00
⚡ clean up code
This commit is contained in:
parent
0fe82ed936
commit
575796cb92
@ -81,8 +81,6 @@ export default class Item extends React.Component<ListItemProps, any> {
|
||||
...others
|
||||
} = this.props;
|
||||
const prefixCls = getPrefixCls('list', customizePrefixCls);
|
||||
const classString = classNames(`${prefixCls}-item`, className);
|
||||
|
||||
const actionsContent = actions && actions.length > 0 && (
|
||||
<ul className={`${prefixCls}-item-action`}>
|
||||
{actions.map((action: React.ReactNode, i: number) => (
|
||||
@ -93,8 +91,9 @@ export default class Item extends React.Component<ListItemProps, any> {
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
|
||||
const extraContent = (
|
||||
const itemChildren = (
|
||||
<div {...others} className={classNames(`${prefixCls}-item`, className)}>
|
||||
{extra ? (
|
||||
<div className={`${prefixCls}-item-extra-wrap`}>
|
||||
<div className={`${prefixCls}-item-main`}>
|
||||
{children}
|
||||
@ -102,15 +101,13 @@ export default class Item extends React.Component<ListItemProps, any> {
|
||||
</div>
|
||||
<div className={`${prefixCls}-item-extra`}>{extra}</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const itemChildren = (
|
||||
<div {...others} className={classString}>
|
||||
{extra ? extraContent : [children, actionsContent]}
|
||||
) : (
|
||||
[children, actionsContent]
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
const mainContent = grid ? (
|
||||
return grid ? (
|
||||
<Col
|
||||
span={getGrid(grid, 'column')}
|
||||
xs={getGrid(grid, 'xs')}
|
||||
@ -125,8 +122,6 @@ export default class Item extends React.Component<ListItemProps, any> {
|
||||
) : (
|
||||
itemChildren
|
||||
);
|
||||
|
||||
return mainContent;
|
||||
};
|
||||
|
||||
render() {
|
||||
|
Loading…
Reference in New Issue
Block a user