aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments/AddComment.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/comments/AddComment.tsx')
-rw-r--r--src/components/comments/AddComment.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/comments/AddComment.tsx b/src/components/comments/AddComment.tsx
index 12fd7e4d..18b9c24e 100644
--- a/src/components/comments/AddComment.tsx
+++ b/src/components/comments/AddComment.tsx
@@ -24,12 +24,14 @@ import {MentionInputControlled} from './MentionInputControlled';
export interface AddCommentProps {
momentId: string;
placeholderText: string;
+ callback?: (message: string) => void;
theme?: 'dark' | 'white';
}
const AddComment: React.FC<AddCommentProps> = ({
momentId,
placeholderText,
+ callback = (msg) => null,
theme = 'white',
}) => {
const {setShouldUpdateAllComments = () => null, commentTapped} =
@@ -55,13 +57,15 @@ const AddComment: React.FC<AddCommentProps> = ({
if (trimmed === '') {
return;
}
+ const message = inReplyToMention + trimmed;
const postedComment = await postComment(
- inReplyToMention + trimmed,
+ message,
objectId,
isReplyingToComment || isReplyingToReply,
);
if (postedComment) {
+ callback(message);
setComment('');
setInReplyToMention('');