mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
🎨 minor touch-ups
This commit is contained in:
parent
423654430e
commit
a0f03c819f
@ -23,6 +23,10 @@ export interface CommentProps {
|
||||
}
|
||||
|
||||
export default class Comment extends React.Component<CommentProps, {}> {
|
||||
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<CommentProps, {}> {
|
||||
}
|
||||
|
||||
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<CommentProps, {}> {
|
||||
children,
|
||||
className,
|
||||
content,
|
||||
prefixCls = 'ant-comment',
|
||||
style = {},
|
||||
prefixCls,
|
||||
style,
|
||||
datetime,
|
||||
...otherProps
|
||||
} = this.props;
|
||||
|
||||
const classString = classNames(prefixCls, className);
|
||||
|
||||
const avatarDom = (
|
||||
<div className={`${prefixCls}-avatar`}>
|
||||
{typeof avatar === 'string' ? <img src={avatar} /> : avatar}
|
||||
@ -110,7 +112,7 @@ export default class Comment extends React.Component<CommentProps, {}> {
|
||||
.map(children, (child: React.ReactElement<any>) => this.renderNested(child));
|
||||
|
||||
return (
|
||||
<div {...otherProps} className={classString} style={style}>
|
||||
<div {...otherProps} className={classNames(prefixCls, className)} style={style}>
|
||||
{comment}
|
||||
{nestedComments}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user