mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
🚨 linting comment
This commit is contained in:
parent
88a3737e61
commit
49e8672e25
@ -117,84 +117,86 @@ exports[`renders ./components/comment/demo/basic.md correctly 1`] = `
|
||||
|
||||
exports[`renders ./components/comment/demo/editor.md correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-comment-inner"
|
||||
class="ant-comment"
|
||||
>
|
||||
<div
|
||||
class="ant-comment-avatar"
|
||||
>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
alt="Han Solo"
|
||||
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="ant-comment-content"
|
||||
class="ant-comment-inner"
|
||||
>
|
||||
<div
|
||||
class="ant-comment-content-author"
|
||||
/>
|
||||
<div
|
||||
class="ant-comment-content-detail"
|
||||
class="ant-comment-avatar"
|
||||
>
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
<span
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
<img
|
||||
alt="Han Solo"
|
||||
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="ant-comment-content"
|
||||
>
|
||||
<div
|
||||
class="ant-comment-content-author"
|
||||
/>
|
||||
<div
|
||||
class="ant-comment-content-detail"
|
||||
>
|
||||
<form
|
||||
class="ant-form ant-form-horizontal"
|
||||
>
|
||||
<div
|
||||
class="ant-form-item-control-wrapper"
|
||||
class="ant-row ant-form-item"
|
||||
>
|
||||
<div
|
||||
class="ant-form-item-control"
|
||||
class="ant-form-item-control-wrapper"
|
||||
>
|
||||
<span
|
||||
class="ant-form-item-children"
|
||||
<div
|
||||
class="ant-form-item-control"
|
||||
>
|
||||
<textarea
|
||||
class="ant-input"
|
||||
data-__field="[object Object]"
|
||||
data-__meta="[object Object]"
|
||||
id="message"
|
||||
rows="4"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
>
|
||||
<div
|
||||
class="ant-form-item-control-wrapper"
|
||||
>
|
||||
<div
|
||||
class="ant-form-item-control"
|
||||
>
|
||||
<span
|
||||
class="ant-form-item-children"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary"
|
||||
type="submit"
|
||||
<span
|
||||
class="ant-form-item-children"
|
||||
>
|
||||
<span>
|
||||
Add Comment
|
||||
</span>
|
||||
</button>
|
||||
</span>
|
||||
<textarea
|
||||
class="ant-input"
|
||||
data-__field="[object Object]"
|
||||
data-__meta="[object Object]"
|
||||
id="message"
|
||||
rows="4"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div
|
||||
class="ant-row ant-form-item"
|
||||
>
|
||||
<div
|
||||
class="ant-form-item-control-wrapper"
|
||||
>
|
||||
<div
|
||||
class="ant-form-item-control"
|
||||
>
|
||||
<span
|
||||
class="ant-form-item-children"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary"
|
||||
type="submit"
|
||||
>
|
||||
<span>
|
||||
Add Comment
|
||||
</span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,3 +1,3 @@
|
||||
import demoTest from '../../../tests/shared/demoTest';
|
||||
|
||||
demoTest('comment');
|
||||
demoTest('comment');
|
||||
|
@ -37,7 +37,7 @@ class App extends React.Component {
|
||||
likes: 0,
|
||||
dislikes: 1,
|
||||
action: 'disliked',
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -75,20 +75,20 @@ class App extends React.Component {
|
||||
<Comment
|
||||
actions={actions}
|
||||
author={<a>Han Solo</a>}
|
||||
avatar={
|
||||
avatar={(
|
||||
<Avatar
|
||||
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
|
||||
alt="Han Solo"
|
||||
/>
|
||||
}
|
||||
content={
|
||||
)}
|
||||
content={(
|
||||
<p>We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.</p>
|
||||
}
|
||||
datetime={
|
||||
)}
|
||||
datetime={(
|
||||
<Tooltip title={moment().format('YYYY-MM-DD HH:mm:ss')}>
|
||||
<span>{moment().fromNow()}</span>
|
||||
</Tooltip>
|
||||
}
|
||||
)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ title:
|
||||
Comment can be used as editor, user can customize the editor component.
|
||||
|
||||
````jsx
|
||||
import { Comment, Icon, Tooltip, Avatar, Form, Button, List, Input } from 'antd';
|
||||
import { Comment, Avatar, Form, Button, List, Input } from 'antd';
|
||||
import moment from 'moment';
|
||||
|
||||
const FormItem = Form.Item;
|
||||
@ -49,7 +49,7 @@ class Editor extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator, getFieldsError, getFieldError, isFieldTouched } = this.props.form;
|
||||
const { getFieldDecorator, getFieldsError } = this.props.form;
|
||||
|
||||
return (
|
||||
<Form onSubmit={this.handleSubmit}>
|
||||
@ -99,7 +99,7 @@ class App extends React.Component {
|
||||
datetime: moment().fromNow(),
|
||||
},
|
||||
...this.state.comments,
|
||||
]
|
||||
],
|
||||
});
|
||||
if (cb) cb();
|
||||
}, 1000);
|
||||
@ -107,27 +107,27 @@ class App extends React.Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div>
|
||||
{this.state.comments.length > 0 && (
|
||||
<CommentList
|
||||
comments={this.state.comments}
|
||||
/>
|
||||
)}
|
||||
<Comment
|
||||
avatar={
|
||||
avatar={(
|
||||
<Avatar
|
||||
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
|
||||
alt="Han Solo"
|
||||
/>
|
||||
}
|
||||
content={
|
||||
)}
|
||||
content={(
|
||||
<EditorForm
|
||||
submitting={this.state.submitting}
|
||||
onSubmit={this.handleSubmit}
|
||||
/>
|
||||
}
|
||||
)}
|
||||
/>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ title:
|
||||
A basic comment used with `antd` List component to render a series of comments.
|
||||
|
||||
````jsx
|
||||
import { Comment, Icon, Tooltip, List } from 'antd';
|
||||
import { Comment, Tooltip, List } from 'antd';
|
||||
import moment from 'moment';
|
||||
|
||||
const data = [
|
||||
|
@ -14,20 +14,19 @@ title:
|
||||
Comment can be nested
|
||||
|
||||
````jsx
|
||||
import { Comment, Icon, Tooltip, Avatar } from 'antd';
|
||||
import moment from 'moment';
|
||||
import { Comment, Avatar } from 'antd';
|
||||
|
||||
function ExampleComment({ children }) {
|
||||
return (
|
||||
<Comment
|
||||
actions={[<span>Reply to</span>]}
|
||||
author={<a>Han Solo</a>}
|
||||
avatar={
|
||||
avatar={(
|
||||
<Avatar
|
||||
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
|
||||
alt="Han Solo"
|
||||
/>
|
||||
}
|
||||
)}
|
||||
content={<p>We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure).</p>}
|
||||
>
|
||||
{children}
|
||||
|
Loading…
Reference in New Issue
Block a user