passed comment text from quick modal to full editor

This commit is contained in:
Sadaqat Ali 2022-04-18 21:09:22 +05:00
parent c1d027689f
commit 607fc807a2
3 changed files with 11 additions and 2 deletions

View File

@ -162,6 +162,7 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
params: {
isReply: true,
post: selectedPost,
quickReplyText: commentValue,
},
});
sheetModalRef.current?.setModalVisible(false);

View File

@ -68,6 +68,7 @@ class EditorContainer extends Component {
isEdit: false,
isPostSending: false,
isReply: false,
quickReplyText: '',
isUploading: false,
post: null,
uploadedImage: null,
@ -87,6 +88,7 @@ class EditorContainer extends Component {
const { currentAccount, navigation } = this.props;
const username = currentAccount && currentAccount.name ? currentAccount.name : '';
let isReply;
let quickReplyText;
let isEdit;
let post;
let _draft;
@ -129,9 +131,10 @@ class EditorContainer extends Component {
}
if (navigationParams.isReply) {
({ isReply } = navigationParams);
({ isReply, quickReplyText } = navigationParams);
this.setState({
isReply,
quickReplyText
});
}
@ -1160,6 +1163,7 @@ class EditorContainer extends Component {
isOpenCamera,
isPostSending,
isReply,
quickReplyText,
isUploading,
post,
uploadedImage,
@ -1191,6 +1195,7 @@ class EditorContainer extends Component {
isOpenCamera={isOpenCamera}
isPostSending={isPostSending}
isReply={isReply}
quickReplyText={quickReplyText}
isUploading={isUploading}
post={post}
saveCurrentDraft={this._saveCurrentDraft}

View File

@ -367,6 +367,7 @@ class EditorScreen extends Component {
isLoggedIn,
isPostSending,
isReply,
quickReplyText,
isUploading,
post,
uploadedImage,
@ -404,6 +405,8 @@ class EditorScreen extends Component {
</Modal>
);
};
console.log('fields :', fields);
console.log('quickReplyText : ', quickReplyText);
return (
<View style={globalStyles.defaultContainer}>
@ -447,7 +450,7 @@ class EditorScreen extends Component {
)}
<MarkdownEditor
componentID="body"
draftBody={fields && fields.body}
draftBody={quickReplyText ? quickReplyText : fields && fields.body}
handleOnTextChange={this._setWordsCount}
handleFormUpdate={this._handleFormUpdate}
handleIsFormValid={this._handleIsFormValid}