mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
⚡️ finalize comment
This commit is contained in:
parent
49e8672e25
commit
423654430e
@ -1,7 +1,6 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders ./components/comment/demo/basic.md correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment"
|
||||
>
|
||||
@ -112,11 +111,9 @@ exports[`renders ./components/comment/demo/basic.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/comment/demo/editor.md correctly 1`] = `
|
||||
<div>
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment"
|
||||
@ -201,7 +198,6 @@ exports[`renders ./components/comment/demo/editor.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/comment/demo/list.md correctly 1`] = `
|
||||
@ -219,7 +215,6 @@ exports[`renders ./components/comment/demo/list.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-spin-container"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment"
|
||||
>
|
||||
@ -271,8 +266,6 @@ exports[`renders ./components/comment/demo/list.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment"
|
||||
>
|
||||
@ -327,11 +320,9 @@ exports[`renders ./components/comment/demo/list.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment"
|
||||
>
|
||||
@ -382,11 +373,9 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-comment-nested"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment"
|
||||
>
|
||||
@ -437,11 +426,9 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-comment-nested"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment"
|
||||
>
|
||||
@ -494,11 +481,9 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-comment-nested"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment"
|
||||
>
|
||||
@ -554,5 +539,4 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
@ -16,8 +16,7 @@ Comment can be nested
|
||||
````jsx
|
||||
import { Comment, Avatar } from 'antd';
|
||||
|
||||
function ExampleComment({ children }) {
|
||||
return (
|
||||
const ExampleComment = ({ children }) => (
|
||||
<Comment
|
||||
actions={[<span>Reply to</span>]}
|
||||
author={<a>Han Solo</a>}
|
||||
@ -32,7 +31,6 @@ function ExampleComment({ children }) {
|
||||
{children}
|
||||
</Comment>
|
||||
);
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<ExampleComment>
|
||||
|
@ -14,8 +14,6 @@ export interface CommentProps {
|
||||
content: React.ReactNode;
|
||||
/** Nested comments should be provided as children of the Comment */
|
||||
children?: any;
|
||||
/** Optional ID for the comment */
|
||||
id?: string;
|
||||
/** Comment prefix defaults to '.ant-comment' */
|
||||
prefixCls?: string;
|
||||
/** Additional style for the comment */
|
||||
@ -101,12 +99,10 @@ export default class Comment extends React.Component<CommentProps, {}> {
|
||||
);
|
||||
|
||||
const comment = (
|
||||
<div {...otherProps} className={classString} style={style}>
|
||||
<div className={`${prefixCls}-inner`}>
|
||||
{avatarDom}
|
||||
{contentDom}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const nestedComments =
|
||||
@ -114,7 +110,7 @@ export default class Comment extends React.Component<CommentProps, {}> {
|
||||
.map(children, (child: React.ReactElement<any>) => this.renderNested(child));
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div {...otherProps} className={classString} style={style}>
|
||||
{comment}
|
||||
{nestedComments}
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 16px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
&-name {
|
||||
transition: color 0.3s ease;
|
||||
transition: color .3s;
|
||||
font-size: 14px;
|
||||
color: @comment-author-name-color;
|
||||
> * {
|
||||
@ -71,7 +71,7 @@
|
||||
color: @comment-action-color;
|
||||
> span {
|
||||
padding-right: 10px;
|
||||
transition: color 0.3s ease;
|
||||
transition: color .3s;
|
||||
font-size: 12px;
|
||||
color: @comment-action-color;
|
||||
cursor: pointer;
|
||||
|
Loading…
Reference in New Issue
Block a user