From 575796cb92db9ce15e5c16735bf583ca35851a57 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 6 Mar 2019 15:23:51 +0800 Subject: [PATCH] :zap: clean up code --- components/list/Item.tsx | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/components/list/Item.tsx b/components/list/Item.tsx index f7df13670d..8c6ab15164 100644 --- a/components/list/Item.tsx +++ b/components/list/Item.tsx @@ -81,8 +81,6 @@ export default class Item extends React.Component { ...others } = this.props; const prefixCls = getPrefixCls('list', customizePrefixCls); - const classString = classNames(`${prefixCls}-item`, className); - const actionsContent = actions && actions.length > 0 && ( ); - - const extraContent = ( -
-
- {children} - {actionsContent} -
-
{extra}
-
- ); - const itemChildren = ( -
- {extra ? extraContent : [children, actionsContent]} +
+ {extra ? ( +
+
+ {children} + {actionsContent} +
+
{extra}
+
+ ) : ( + [children, actionsContent] + )}
); - const mainContent = grid ? ( + return grid ? ( { ) : ( itemChildren ); - - return mainContent; }; render() {