mirror of
https://github.com/wassname/talk.git
synced 2026-07-11 16:39:49 +08:00
Changes
This commit is contained in:
@@ -74,12 +74,12 @@ export class EditableCommentContent extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handleBodyChange = (body, ...data) => {
|
||||
handleBodyChange = (body, data) => {
|
||||
this.setState(state => ({
|
||||
body,
|
||||
data: {
|
||||
...state.data,
|
||||
...data[0],
|
||||
...data,
|
||||
},
|
||||
}));
|
||||
};
|
||||
|
||||
@@ -90,12 +90,12 @@ class CommentBox extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
handleBodyChange = (body, ...data) => {
|
||||
handleBodyChange = (body, data) => {
|
||||
this.setState(state => ({
|
||||
body,
|
||||
data: {
|
||||
...state.data,
|
||||
...data[0],
|
||||
...data,
|
||||
},
|
||||
}));
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@ const STORAGE_PATH = 'DraftArea';
|
||||
/**
|
||||
* An enhanced textarea to make comment drafts.
|
||||
*/
|
||||
export default class DraftAreaContainer extends React.Component {
|
||||
class DraftAreaContainer extends React.Component {
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
this.initValue();
|
||||
@@ -24,8 +24,8 @@ export default class DraftAreaContainer extends React.Component {
|
||||
return `${STORAGE_PATH}_${this.props.id}`;
|
||||
};
|
||||
|
||||
onChange = (...args) => {
|
||||
this.props.onChange && this.props.onChange(...args);
|
||||
onChange = (body, data) => {
|
||||
this.props.onChange && this.props.onChange(body, data);
|
||||
};
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
@@ -50,7 +50,6 @@ export default class DraftAreaContainer extends React.Component {
|
||||
charCountEnable={this.props.charCountEnable}
|
||||
maxCharCount={this.props.maxCharCount}
|
||||
label={this.props.label}
|
||||
comment={this.props.comment}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -73,3 +72,5 @@ DraftAreaContainer.propTypes = {
|
||||
rows: PropTypes.number,
|
||||
label: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export default DraftAreaContainer;
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"timeago.js": "^2.0.3",
|
||||
"timekeeper": "^1.0.0",
|
||||
"tlds": "^1.196.0",
|
||||
"turndown": "^4.0.1",
|
||||
"uglifyjs-webpack-plugin": "^1.1.6",
|
||||
"url-join": "^2.0.2",
|
||||
"url-loader": "^0.6.0",
|
||||
|
||||
Reference in New Issue
Block a user