mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Passing down root data
This commit is contained in:
@@ -50,10 +50,11 @@ class CommentForm extends React.Component {
|
||||
onCancel: PropTypes.func,
|
||||
state: PropTypes.string,
|
||||
loadingState: PropTypes.oneOf(['', 'loading', 'success', 'error']),
|
||||
comment: PropTypes.object,
|
||||
registerHook: PropTypes.func,
|
||||
unregisterHook: PropTypes.func,
|
||||
isReply: PropTypes.bool,
|
||||
root: PropTypes.object.isRequired,
|
||||
comment: PropTypes.object,
|
||||
};
|
||||
static get defaultProps() {
|
||||
return {
|
||||
@@ -92,6 +93,7 @@ class CommentForm extends React.Component {
|
||||
body,
|
||||
loadingState,
|
||||
comment,
|
||||
root,
|
||||
} = this.props;
|
||||
|
||||
const length = body.length;
|
||||
@@ -109,6 +111,7 @@ class CommentForm extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<DraftArea
|
||||
root={root}
|
||||
comment={comment}
|
||||
id={this.props.bodyInputId}
|
||||
label={this.props.bodyLabel}
|
||||
|
||||
@@ -28,10 +28,12 @@ class ReplyBox extends React.Component {
|
||||
maxCharCount,
|
||||
charCountEnable,
|
||||
comment,
|
||||
root,
|
||||
} = this.props;
|
||||
return (
|
||||
<div className={cn(styles.container, `${name}-textarea`)}>
|
||||
<CommentBox
|
||||
root={root}
|
||||
comment={comment}
|
||||
maxCharCount={maxCharCount}
|
||||
charCountEnable={charCountEnable}
|
||||
@@ -50,7 +52,6 @@ class ReplyBox extends React.Component {
|
||||
}
|
||||
|
||||
ReplyBox.propTypes = {
|
||||
comment: PropTypes.object,
|
||||
charCountEnable: PropTypes.bool.isRequired,
|
||||
maxCharCount: PropTypes.number,
|
||||
setActiveReplyBox: PropTypes.func.isRequired,
|
||||
@@ -61,6 +62,8 @@ ReplyBox.propTypes = {
|
||||
assetId: PropTypes.string.isRequired,
|
||||
currentUser: PropTypes.object,
|
||||
styles: PropTypes.object,
|
||||
root: PropTypes.object.isRequired,
|
||||
comment: PropTypes.object,
|
||||
};
|
||||
|
||||
export default ReplyBox;
|
||||
|
||||
@@ -286,6 +286,7 @@ class Stream extends React.Component {
|
||||
{banned && <BannedAccount />}
|
||||
{showCommentBox && (
|
||||
<CommentBox
|
||||
root={root}
|
||||
notify={notify}
|
||||
postComment={postComment}
|
||||
appendItemArray={appendItemArray}
|
||||
|
||||
@@ -150,7 +150,14 @@ class CommentBox extends React.Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { isReply, maxCharCount, assetId, parentId, comment } = this.props;
|
||||
const {
|
||||
isReply,
|
||||
maxCharCount,
|
||||
assetId,
|
||||
parentId,
|
||||
comment,
|
||||
root,
|
||||
} = this.props;
|
||||
let { onCancel } = this.props;
|
||||
|
||||
if (isReply && typeof onCancel !== 'function') {
|
||||
@@ -168,6 +175,7 @@ class CommentBox extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<CommentForm
|
||||
root={root}
|
||||
comment={comment}
|
||||
defaultValue={this.props.defaultValue}
|
||||
bodyLabel={isReply ? t('comment_box.reply') : t('comment.comment')}
|
||||
@@ -213,6 +221,7 @@ CommentBox.propTypes = {
|
||||
canPost: PropTypes.bool,
|
||||
notify: PropTypes.func.isRequired,
|
||||
tags: PropTypes.array,
|
||||
root: PropTypes.object.isRequired,
|
||||
comment: PropTypes.object,
|
||||
};
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class DraftAreaContainer extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const queryData = { comment: this.props.comment };
|
||||
const queryData = { comment: this.props.comment, root: this.props.root };
|
||||
|
||||
return (
|
||||
<DraftArea
|
||||
@@ -80,10 +80,11 @@ DraftAreaContainer.propTypes = {
|
||||
disabled: PropTypes.bool,
|
||||
rows: PropTypes.number,
|
||||
label: PropTypes.string.isRequired,
|
||||
comment: PropTypes.object,
|
||||
registerHook: PropTypes.func,
|
||||
unregisterHook: PropTypes.func,
|
||||
isReply: PropTypes.bool,
|
||||
root: PropTypes.object.isRequired,
|
||||
comment: PropTypes.object,
|
||||
};
|
||||
|
||||
const slots = ['draftArea'];
|
||||
|
||||
@@ -5655,7 +5655,7 @@ jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
|
||||
jsdom@^11.3.0, jsdom@^11.5.1, jsdom@^11.6.2:
|
||||
jsdom@^11.5.1, jsdom@^11.6.2:
|
||||
version "11.6.2"
|
||||
resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.6.2.tgz#25d1ef332d48adf77fc5221fe2619967923f16bb"
|
||||
dependencies:
|
||||
@@ -10413,12 +10413,6 @@ tunnel-agent@~0.4.1:
|
||||
version "0.4.3"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
|
||||
|
||||
turndown@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/turndown/-/turndown-4.0.1.tgz#1383dd01ac8d96fa106a7f13e0b0a7977588131a"
|
||||
dependencies:
|
||||
jsdom "^11.3.0"
|
||||
|
||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
version "0.14.5"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
|
||||
Reference in New Issue
Block a user