From a0f03c819f68d9281c87eeead0b6521814f71501 Mon Sep 17 00:00:00 2001 From: ilanus Date: Thu, 1 Nov 2018 19:28:21 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20minor=20touch-ups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/comment/index.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/comment/index.tsx b/components/comment/index.tsx index 1572f62ba8..f808e76bdb 100644 --- a/components/comment/index.tsx +++ b/components/comment/index.tsx @@ -23,6 +23,10 @@ export interface CommentProps { } export default class Comment extends React.Component { + static defaultProps = { + prefixCls: 'ant-comment', + } + getAction(actions: React.ReactNode[]) { if (!actions || !actions.length) { return null; @@ -37,7 +41,7 @@ export default class Comment extends React.Component { } renderNested = (child: any) => { - const { prefixCls = 'ant-comment' } = this.props; + const { prefixCls } = this.props; const classString = classNames(`${prefixCls}-nested`); return ( @@ -55,14 +59,12 @@ export default class Comment extends React.Component { children, className, content, - prefixCls = 'ant-comment', - style = {}, + prefixCls, + style, datetime, ...otherProps } = this.props; - const classString = classNames(prefixCls, className); - const avatarDom = (
{typeof avatar === 'string' ? : avatar} @@ -110,7 +112,7 @@ export default class Comment extends React.Component { .map(children, (child: React.ReactElement) => this.renderNested(child)); return ( -
+
{comment} {nestedComments}